I have 2 large files each containing long strings separated by newlines in different formats. I need to find similarities and differences between them. The Problem is that the formats of the two files differ. File a: File b: So now I want to extract the whole line containing NjA5MDAxNdaeag0NjE5NTIx.XUwXRQ.gat…
Tag: linux
How to make a one-window program with GTK, python and glade?
I’d like to write a program that has one main window and if I click on a button it changes the content of the window (or something similar) and the user can go back after that to the “home page”. I’m using python3, gtk3 and glade on Ubuntu 19.04. Here’s the example.glade XML file…
capturing words between double quotes in awk
I’m trying to print the name of my Linux distribution. The output of cat /etc/os-release for my distro is: Now I want to grab the Arch Linux from the second line. I used this command: But this prints PRETTY_NAME=”Arch How can I grab the words (including space) from this line? Answer Setting the fi…
can not connect to postgres db from node server
I want to connect my apps nodejs using node-posgres to PostgreSQL. My apps in linux server and my postgresql in another linux server by 176.9.154.123 IP. this is my error: this is my pg_hba.conf: Answer i can solve this problem by add this line to postgressql.conf:
Create filename based on file output in shell
I’m looking to create files with names based on the command output of the previous command i.e. if i run So that the output of the amount of files of that type is the filename of the created file. Answer Here’s a solution that renames the file after it has been created: What is happening in this o…
why virtual address of LOAD program header and runtime virtual address shown by gdb is different?
I’ve been trying to understand elf file format and on elf format documentation, VirtAddr of LOAD header should be the virtual address of the loaded segment. But gdb memmap shows segments to be loaded at different virt address. gdb memmap Answer VirtAddr of LOAD header should be the virtual address of th…
How to avoid creating tmp-Files on Linux?
I have a program that needs to access a file. The content of this file is in a variable and I want to avoid creating a real file. Is it possible to create some kind of virtual file?? Normally I would pipe this to the command, but STDIN already “in use”. Is there any way to pass both variables to
How to extract names of compound present in sub files?
I have a list of 15000 compound names (file name: uniq-compounds) which contains names of 15000 folder. the folder have sub files i.e. out.pdbqt which contains names of compound in 3rd Row. (Name = 1-tert-butyl-5-oxo-N-[2-(3-pyridinyl)ethyl]-3-pyrrolidinecarboxamide). I want to extract all those 15000 names b…
Bash loop only read the last line
I have problems trying to extract data behind colons in multiple lines using while loop and awk. This is my data structure: What I want to get is the BioSample ID, which is like SAMD00019077. Scripts I tried: while read line ; do echo $line | awk -F’:’ ‘{print $3}’ > 1.tmp2 ; done &…
[[ operator fails with error “conditional binary operator expected”
Linux bash script fails for the following line. Error message as given. I know i can simply use if [ -f file1.txt ] but curious to know what needs to be fixed to make this working. conditional binary operator expected expected `)’ Answer The mv command shouldn’t be inside the conditional expressio…