On Wed, Nov 24, 2010 at 3:48 AM,  <jhoomshar...@netscape.net> wrote:
> I want to use the following shell command in my build.xml file
> ls -l ../../../jobs/ | awk '{ print $9 }' > content.txt

AFAIK, the 9th field of ls -l is the filename, so your "ls -l path |
awk '{ print $9 }'" is better replaced with simply "ls -1".

Then this becomes (untested):

<exec executable="ls" outputproperty="content.txt">
  <arg value="-1" />
  <arg file="../../../jobs" />
</exec>

But I'm sure there's a way to do it portably in pure Ant too, without
forking to ls. --DD

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org

Reply via email to