Reputation: 17553
I want to run a command like this:
while read p; grep name_ $p.config | awk -F'=' '{ print $2 }' | tr p1328 p1512 > $p.1512.config ; done < allbkgds.txt
However, this fails with the following error:
-bash: syntax error near unexpected token `done'
I can't quite understand what is going wrong because the inner command works fine:
grep name_ $p.config | awk -F'=' '{ print $2 }' | tr p1328 p1512 > $p.1512.config
I basically want to take some strings from the first config file and dump it into a second config file within the bash file loop.
Upvotes: 0
Views: 121