> -----Original Message----- > From: Ken Wood [mailto:[EMAIL PROTECTED] > > I guess I'm confused. > > I'm doing > <exec executable="cat" > dir="."> > <arg line="etc/jsm.properties | sed -f > tools/jsmprops_sedscriptfile > > application/server/log/jsm.properties" /> > </exec> > > Ant DOES 'cat etc/jsm.properties" but it barfs on the rest, because > it apparently wants to interpret every token on the arg list as files: > > [exec] cat: cannot open | > [exec] cat: cannot open sed > [exec] cat: cannot open -f > [exec] cat: cannot open > > > This example is trivial, but more generally it is quite common on Unix > to execute a command and pipe the output through one or more programs, > and > sometimes redirect the output. In this case, we are creating a new > file from a template using some regular expression pattern matching > and replacements.... > > How do I uses pipes and IO re-direction in an 'exec' ??? >
You are trying to use OS specific features, (which are not portable). Try using: "sh -c '.........'" or write a shell script that you can invoque from ANT and that does all this work for you. Jose Alberto
