I ran into a problem in a bash shell script. This script should execute the following script shell (./script here), and the script output is redirected to a file (tmp). Then the file should be read line by line and the same script (./script) should be executed for each line, giving the line as an argument, and the result should be saved in the file (tmp1). Ultimately, these results should be added to the first file (tmp).
I embed the script below:
./script $1 $2 > tmp
cat tmp | while read a
do
./script $a $2 >> tmp1
done
cat tmp1 | while read line
do
./script $line $2 >> tmp
done
I get the following error while running the script "./script: line 11: syntax error: unexpected end of file"
Can someone help me with this?
Thank you very much in advance.
source
share