-------- Original Message  --------
Subject: Re: How to retrieve IP address
From: Dominique Devienne <[email protected]>
To: Ant Users List <[email protected]>
Date: Mon Jan 31 2011 16:08:21 GMT+0100 (CET)

> On Mon, Jan 31, 2011 at 2:03 AM, hezjing <[email protected]> wrote:
>> May I know if it is possible to retrieve the IP address of the running
>> server in Ant?
> 
> Google found it for me in Antelope, a 3rd party collection of Ant tasks:
> 
> http://antelope.tigris.org/nonav/docs/manual/bk03ch16.html
> 
> Might be possible with pure Ant too, not sure where though. --DD

Simply use a shell wrapped up in <exec> task, output caught via
outputproperty for further processing, f.e. =

/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'

Windows user may use ipconfig ..


Regards, Gilbert






---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to