Thanks very much
Peiman
I've optimized it a bit by following Andres Cabrera's suggestion using the --omacro flag. This new command removes a few very unnecessary steps, including generating multiple files then deleting them. It's also much easier to read.
for i in `ls *.aif | sed 's/.aif//'` ; do csound -d -A --omacro:theFile=$i.aif -o$i.batch.aif batchfx2.csd ; done
I also removed the following line for the .csd file:
# define theFile #FILENAME#
BTW, thanks for asking such a great question. I've never even considered that Csound could be used as an fx batch processor. Turns out, it's pretty quick and easy to use it as one. I'll be playing around with this off and on over the next few days.
That's very clever! I will give it a try, I am more familiar with csh command-line so I will spend some-time understanding your command. I get the general idea though :-)