I have two files. file.txt and delete.txt file.txt contains the following for ex.: delete.txt contains: I need to delete the rows from file.txt that are contained within delete.txt cat file.txt should result with: So far I’ve tried this with no luck: I don’t receive any error, it just doesn’t edit my file.txt file. I’ve tested the while loop with an
Tag: unix
Combining find command conditions
I am trying to combine 2 find commands to pipe to a grep pattern match. my 3 commands are: get files modified in the last 24 hours: ignore a couple of directories: find pattern in the file’s lines: I have gotten below to work but cant seem to add directory skipping into the mix. get files modified in the last
Re-arranging lines after a pattern in a file according to a specific order
I have a large log file with the below format I have created a shell script that insert those values in the database in the same order val1, val2, val3 ,val4 The problem is that the files sometimes gets corrupted and the variables come in different order, like below for example: Using shell script, I want to rearrange the lines
C: Stop executing and jump to specific point in program on receiving a signal
I have written a code where two independent programs (say 1 & 2) are communicating via message queues. Each programs sends a message of a specific mtype and waits for response of specific mtype. Based on the mtype functions are invoked. program 2 initially waits on select() on the message queue waiting for message chain initiation from program 1 and
Why cat 0>file doesn’t work
In Unix, I know that 0 1 and 2 represent stdin stdout and stderr. As my understanding, the command cat meaning “concatenate” can concatenate different files. For example, cat file>&1 can concatenate the file and the stdout and the arrow means the redirection from the fileto the stdout, so we can see the content of the file from the terminal
In linux system, how to find the words (immediately next alone) next to a given word in a file?
I need to find all the table names alone in all select statements in my query log. Is there any way to grep (or) any other option, to take the strings that comes immediately after the word FROM in my file .. Example: file contains something like this Now I want the list of the distinct tables alone from the
LINUX GNU Create New user Postgres DB in Makefile
I’m new with Makefile. I need to automate create user for postgres terminal. I tried this example and it did not work for me: Neither @create user myusername; nor @/q works. When I ran make createuser and exit manually with q from postgres terminal, I receive this error: Answer When debugging makefiles, the @ modifier is unhelpful, as it no
Does downloading g++ to windows guarantee you will compile Unix projects successfully?
So here is the link : http://www1.cmc.edu/pages/faculty/alee/g++/g++.html My Unix project uses this : Is it a guarantee? I heard that you can compile the Unix projects using g++ (I have makefile too). I am only familiar about Windows and I don’t know anything about Linux and Mac. Answer No guarantee. I’m close to say: “impossible, except for very simple code”.
How to implement a process overseeing another process?
Currently at my workplace I have a script named “batch launcher” (written in bash), which is supposed to oversee the execution of batches, logging their output and processing the return code of the batch. This is currently done via env call within this “batch launcher”: Several days ago, one of the batches written in perl made a kill call on
Track down high CPU load average
Trying to understand what’s going on with my server. It’s a 2 cpu server, so: While on load avergae, queue is showing ~8 : So You can assume, load is really high and things are pailing up, there is some load on the system and it’s not just a spike. However, Looking at top cpu consumers: Results of free command: