ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chuck Holzwarth <>
Subject Re: How to capture [exec]
Date Wed, 09 Jan 2008 15:41:56 GMT
You may be getting the result of the Powershell rather than the ping. 

You may want to simply exec ping. 

With Powershell you may have to create a script that captures the result of the command and
exits with the error indicator. If Powershell works similar to Unix/Linux/Solaris etc. shells,
you are adding an additional level of abstraction. Errors often don't flow up the process
stack unless you set the criteria to do so.

As noted by some other posts, ping is testing the interface, not the OS. Ping can succeed
even when the host OS is down or the service you want is down depending on the network card
that is installed.

Z W <> wrote: Hi

I have a Powershell script that contains the line "exit 2" when ping fails
>From Ant, it's showing

     [echo]  Inside _build_ping_alive module
     [exec] Pinging host1 ...
     [exec] success
     [exec] Pinging host2 ...
     [exec] error: 11010 occurred
     [exec] LastExitCode: 0
     [exec] error.count: 0
     [exec] *Result: 1*
How to I capture the 1 with Ant ?
In Ant, I have





Thank you,
Chuck Holzwarth
(804) 403-3478 (home)
(540) 335-3171 (cell)
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message