I have a situation where I have a bunch of config files that define filters, I want to cat a file and run it through all these filters, capturing the output
the command line to do so would be something like: cat input |./filter1 -r file1 |./filter1 -r file2 |./filter2 -r file3 >output the following line produces a line that looks like this echo -n "cat input | "; ls *.meta |cut -f 1 -d "." |while read file; do grep "^Filter: " $file.meta |head -1 |cut -f 2 -d " " |while read filter; do echo -n "./$filter -r $file | "; done; done; echo "cat >output" If I do a cut-n-paste of this output into the shell it works however when I then try to put it in backticks to execute it I get errors about cat not accepting the -r option `echo -n "cat input | "; ls *.meta |cut -f 1 -d "." |while read file; do grep "^Filter: " $file.meta |head -1 |cut -f 2 -d " " |while read filter; do echo -n "./$filter -r $file | "; done; done; echo "cat >output"` cat: invalid option -- r Try `cat --help' for more information why is this not working? (I'm running this under bash) David Lang _______________________________________________ Discuss mailing list [email protected] https://lists.lopsa.org/cgi-bin/mailman/listinfo/discuss This list provided by the League of Professional System Administrators http://lopsa.org/
