You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by grayaii <ge...@rsa.com> on 2012/01/13 21:16:18 UTC

determine what shellscript just ran

A lot of our build.xmls contain things like this, where “ls -l /tmp” is just
some arbitrary command:

<antcontrib:shellscript shell="bash" failonerror="true">
                ls -l /tmp
</antcontrib:shellscript>

When you run this (with verbosity on), you get the output of ls. So far so
good.

What you *don’t* get is what command just ran.  In this case, we do not see
“ls -l /tmp” anywhere in ant's output!
The only thing you do see is the name of shell script that was generated
on-the-fly :

[antcontrib:shellscript] Executing 'bash' with arguments:
[antcontrib:shellscript] '/tmp/script1463789709null'

Do you know how to get ant to echo what just ran?

I have a bunch of build logs (which is just the output of ant), and I can't
tell what command caused what output.


--
View this message in context: http://ant.1045680.n5.nabble.com/determine-what-shellscript-just-ran-tp5143649p5143649.html
Sent from the Ant - Users mailing list archive at Nabble.com.

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


Re: determine what shellscript just ran

Posted by Peter Reilly <pe...@gmail.com>.
The only way I can see, is to set shell into debug mode, using set -x

<antcontrib:shellscript shell="bash" failonerror="true">
  set -x
   ls -l /tmp
</antcontrib:shellscript>

Peter
On Fri, Jan 13, 2012 at 8:16 PM, grayaii <ge...@rsa.com> wrote:
> A lot of our build.xmls contain things like this, where “ls -l /tmp” is just
> some arbitrary command:
>
> <antcontrib:shellscript shell="bash" failonerror="true">
>                ls -l /tmp
> </antcontrib:shellscript>
>
> When you run this (with verbosity on), you get the output of ls. So far so
> good.
>
> What you *don’t* get is what command just ran.  In this case, we do not see
> “ls -l /tmp” anywhere in ant's output!
> The only thing you do see is the name of shell script that was generated
> on-the-fly :
>
> [antcontrib:shellscript] Executing 'bash' with arguments:
> [antcontrib:shellscript] '/tmp/script1463789709null'
>
> Do you know how to get ant to echo what just ran?
>
> I have a bunch of build logs (which is just the output of ant), and I can't
> tell what command caused what output.
>
>
> --
> View this message in context: http://ant.1045680.n5.nabble.com/determine-what-shellscript-just-ran-tp5143649p5143649.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>

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


Re: determine what shellscript just ran

Posted by grayaii <ge...@rsa.com>.
that's a good idea.  I'll create a macrodef to do just that.


--
View this message in context: http://ant.1045680.n5.nabble.com/determine-what-shellscript-just-ran-tp5143649p5148852.html
Sent from the Ant - Users mailing list archive at Nabble.com.

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