Skip to content

Tag: scripting

linux running few scripts launch from a central script

I have several bash script which contain in them infinite while loop. I would like to run all of them from a single script: what I get is that it stuck on the first script and it does not proceed to the next one to run them simultaneous. Answer Notice the & symble at the end of each line, that

Print grep Keyword if grep find a match

I have an input file Input.txt with the following sample keywords: I also have a file Text.txt to search such as: I want to print grep Keyword followed by a match if the grep finds a match. The desired output: Answer With awk you could do something like this: In a more readable format it would be:

In bash got unwanted newlines after sed and cat >>

I’m trying to substitute some lines in /etc/hosts file with my script here: It searches e.g. for lines like and replaces the line (if it’s found) with a sed command to nothing, but adds afterwards e.g. to I’m having to do (?) this because my LAN network addresses are changing very often (exa…