I am running a bash script that I input a file, it reads the file and runs through the file in a loop. my problem is my awk command. I am not sure why I am getting the error I get
I input a file running the script as such
./almost.sh < text.txt
The script is
#!/bin/bash
while read STRING
do
echo $STRING
"awk -v RS='' -v ORS='\n\n' $STRING file.txt" >> out.txt
#grep $STRING dbutils.list.Volume.txt >> out.txt
done
The output I get is
00061
./almost.sh: line 6: awk -v RS='' -v ORS='\n\n' 00061 list.txt: command not found
00062
./almost.sh: line 6: awk -v RS='' -v ORS='\n\n' 00062 list.txt: command not found
00091
./almost.sh: line 6: awk -v RS='' -v ORS='\n\n' 00091 list.txt: command not found
000C1
./almost.sh: line 6: awk -v RS='' -v ORS='\n\n' 000C1 list.txt: command not found
000C2
./almost.sh: line 6: awk -v RS='' -v ORS='\n\n' 000C2 list.txt: command not found
Could someone help out with the awk command? the command works fine if it is not in a loop but just ran once.