I have a shell script that calls (inside it) an .awk program . I would like to assign the output of the awk program to a variable :
# test.sh
var=$(program.awk file1 | grep KO)
echo "value of var : $var" # I get an empty value of $var
Knowing that when I execute the .awk program I get :
$ program.awk file1 | grep KO
awk: program.awk:80: warning: escape sequence `\.' treated as plain `.'
I would like to assign the above output line to $var variable.
Thanks in advance for your help.