I am trying to write a script that for each text file in a directory,
print the file, pipe the result to awk, pipe the result to sed, then
append the data to an output file.
In a script, I have:
#!/bin/sh
for FILE in ./*TXT
do
cat $FILE
done
Initially, I was piping the result within the script
( e.g., cat $FILE | awk { instructions } | sed "instructions" >>
file.foo ), but that errored.
Next, I tried calling the script like this:
$ ./fileread.sh | awk -F"%%" {print $1 "\n"} | etc... >> file.foo
which results in a broken pipe.
I am probably missing something simple. Can someone point me in the
right direction?