AWK isn't best used to do "inplace" substitutions in files. The closest to that would be something like redirecting the output to a tmp file, and then over-write the original...
#!/bin/bash
# awk.sh
infil="./awk.data"
awk '/apple/ { gsub(/red/, "blue") } /berry/ { gsub(/yellow/, "green") }1'...
I don't mind helping with scripts, but, I'm not good at teaching or writing books. There are better sources than me to learn from. Starting with the command line, there is a lot of help and documentation at hand.
@commandline
Type:
help help
man man
info <command>
Tutorials...
I have no idea what I'm doing here. You could try substituting the printf cmd with the nohup call in 2 places...
# printf "%s\n" $fld1
nohup ./prox.sh $fld1 > ./prox.log 2>&1 </dev/null &
wait
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.