--- "Ditrick, Gregory" <[EMAIL PROTECTED]>
wrote:
> Not a bad idea to use <ac:shellscript>, if you are
> not doing cross
> platform stuff.
> The use of a lot of this type of thing,
> <ac:shellscript>, can make the
> ant script platform dependent or you will require
> additional products
> like Cygwin for Windows.
>
> Using redirectors can make this type of thing
> platform independent.
> But, I've found that you usually have to use
> intermediate flat files to
> re-create all the pipes. This then has the cost of
> I/O, but gives you
> an the desired platform independent scripts.
>
I confess myself curious to see a exec/redirector
situation so complex it cannot be solved by nested
filterchains. I'm sure it's possible to concoct such
a scenario, but most real-world requirements I would
imagine can be done in a single pass.
FWIW,
Matt
> So, you have to weigh the solution with big picture.
> If you are never
> ever going to another platform like Microsoft then
> definitely use the
> <ac:shellscript> task. If there is any chance of
> going to Microsoft use
> redirectors and intermediate files.
>
> Using intermediate files then you use the <exec>
> task with a command in
> a property like ${os.filedump.cmd} and redirectors
> to get your desired
> output. In a os specific properties file you'll set
> os.filedump.cmd to
> the desired command: i.e. cat for unix, type for
> windows, etc. A lot
> more work, but will save you a lot of time if you
> have to move your
> script from Unix to Windows. And then you are not
> dependent on Cygwin
> being installed on the Windows box.
>
> Again, you must weigh and see the big picture: if
> the ant script will
> never ever be ran on Windows, then use
> <ac:shellscript>. Or, you'll be
> okay if having Cygwin install on the Windows box is
> not a big burden
> (lots of boxes or don't have admin rights on all
> Windows' boxes).
>
> My 2 cents on the subject.
>
> Keep smiling,
>
> GregD
> 6-8309
>
> -----Original Message-----
> From: Vihan Pandey [mailto:[EMAIL PROTECTED]
> Sent: Monday, August 20, 2007 10:35 AM
> To: Ant Users List
> Subject: Re: for task with inline exec?
>
> > Why not use shellscript?
>
> didn't think of it :-)
>
>
---8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<------
> -8-<----
>
> <shellscript shell="bash" outputproperty="js.list">
> cat deploy.properties | grep .js-version| sed
> s/.js-version=v.[0-9]*/,/g | tr -d '\n' | sed
> s/,$//g
> </shellscript>
>
> <echo>JS list: ${js.list}</echo>
>
> <for list="${js.list}" param="myval">
>
> <sequential>
> <replace dir="${docroot-re01}"
> token="/javascripts/@{myval}.js"
>
value="http://js.cleartrip.com/javascripts/@[EMAIL PROTECTED]
> n}.js"
> >
> <include name="**/*.html"/>
> <include name="**/*.shtml"/>
> </replace>
> </sequential>
> </for>
>
>
---8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<------
> -8-<----
>
> Now it works beautifully :-)
>
> Thanks a million Jan and Peter !!!
>
> Regards,
>
> -vihan
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
>
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
>
____________________________________________________________________________________
Sick sense of humor? Visit Yahoo! TV's
Comedy with an Edge to see what's on, when.
http://tv.yahoo.com/collections/222
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]