You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Barry Pape <bp...@netspend.com> on 2008/01/04 21:25:42 UTC

environment attribute

Howdy all,

Hopefully this is a quick and easy question.  Is the environment
attribute of the property task supported on Solaris?  I've been trying
to use ${env.HOSTNAME} but it doesn't appear to resolve.

For instance:
    <target name="hostname ">
        <property environment="env"/>
		  <property name="hostname" value="${env.HOSTNAME}"/>
        <echo>Using ${hostname} for host name</echo>
    </target>

Which results in:
$ ant hostname
Buildfile: build.xml

hostname:
     [echo] Using ${env.HOSTNAME} for host name

BUILD SUCCESSFUL
Total time: 2 seconds

Any help is much appreciated.
Barry

And Happy New Year to all!



-----------------------------------------
Confidentiality Notice!
This electronic transmission and any attached documents or other
writings are confidential and are for the sole use of the intended
recipient(s) identified above. This message may contain information
that is privileged, confidential or otherwise protected from
disclosure under applicable law. If the receiver of this
information is not the intended recipient, or the employee, or
agent responsible for delivering the information to the intended
recipient, you are hereby notified that any use, reading,
dissemination, distribution, copying or storage of this information
is strictly prohibited. If you have received this information in
error, please notify the sender by return email and delete the
electronic transmission, including all attachments from your
system.


RE: environment attribute

Posted by Barry Pape <bp...@netspend.com>.
Good call on the sub shells.  Thanks for the help!

-----Original Message-----
From: Chuck Holzwarth [mailto:chuck_holzwarth@yahoo.com] 
Sent: Monday, January 07, 2008 8:17 AM
To: Ant Users List
Subject: RE: environment attribute

Try using the ant exec task to run the env command. Are you sure the
HOSTNAME variable is exported to sub shells? Does cruisecontrol execute
under your ID or asynchronously? It is possible that cruisecontrol runs
under a different ID even if you kick it off manually. The output of the
env command should give an indication.

Barry Pape <bp...@netspend.com> wrote: Thanks for the feedback.

I verified that the HOSTNAME variable is set, but it doesn't get
resolved during the ant build.

cruisecontrol@dev02
~/cruisecontrol/projects/webnew-dec2007/netsoft/webnew
$ echo $HOSTNAME
dev02

cruisecontrol@dev02
~/cruisecontrol/projects/webnew-dec2007/netsoft/webnew
$ ant hostname
Buildfile: build.xml

hostname:
     [echo] Using ${env.HOSTNAME} for host name

BUILD SUCCESSFUL
Total time: 5 seconds



Not sure if any of this information helps, but here:

cruisecontrol@dev02
~/cruisecontrol/projects/webnew-dec2007/netsoft/webnew
$ uname -rsv
SunOS 5.10 Generic_125100-10

cruisecontrol@dev02
~/cruisecontrol/projects/webnew-dec2007/netsoft/webnew
$ echo $OSTYPE
solaris2.10


Thanks,
Barry


-----Original Message-----
From: Chuck Holzwarth [mailto:chuck_holzwarth@yahoo.com] 
Sent: Friday, January 04, 2008 3:03 PM
To: Ant Users List
Subject: Re: environment attribute

I just tried this on a Solaris VM on my desktop and HOSTNAME is not
defined by default. You may want to issue "export HOSTNAME=`hostname`"
in your .profile. Change this as appropriate for your shell.

Dominique Devienne 
    wrote: On 1/4/08, Barry Pape
wrote:
> Hopefully this is a quick and easy question.  Is the environment
> attribute of the property task supported on Solaris?

Yes.

> I've been trying
> to use ${env.HOSTNAME} but it doesn't appear to resolve.

Most likely because you have no such env. var. in your current shell.
Verify that using echo $HOSTNAME in the same shell you run Ant from.

Available env. vars varies by OS and shell usually. --DD

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




Thank you,
Chuck Holzwarth
(804) 403-3478 (home)
(540) 335-3171 (cell)
       
---------------------------------
Looking for last minute shopping deals?  Find them fast with Yahoo!
Search.

-----------------------------------------
Confidentiality Notice!
This electronic transmission and any attached documents or other
writings are confidential and are for the sole use of the intended
recipient(s) identified above. This message may contain information
that is privileged, confidential or otherwise protected from
disclosure under applicable law. If the receiver of this
information is not the intended recipient, or the employee, or
agent responsible for delivering the information to the intended
recipient, you are hereby notified that any use, reading,
dissemination, distribution, copying or storage of this information
is strictly prohibited. If you have received this information in
error, please notify the sender by return email and delete the
electronic transmission, including all attachments from your
system.


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




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.

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


RE: environment attribute

Posted by Chuck Holzwarth <ch...@yahoo.com>.
Try using the ant exec task to run the env command. Are you sure the HOSTNAME variable is exported to sub shells? Does cruisecontrol execute under your ID or asynchronously? It is possible that cruisecontrol runs under a different ID even if you kick it off manually. The output of the env command should give an indication.

Barry Pape <bp...@netspend.com> wrote: Thanks for the feedback.

I verified that the HOSTNAME variable is set, but it doesn't get
resolved during the ant build.

cruisecontrol@dev02
~/cruisecontrol/projects/webnew-dec2007/netsoft/webnew
$ echo $HOSTNAME
dev02

cruisecontrol@dev02
~/cruisecontrol/projects/webnew-dec2007/netsoft/webnew
$ ant hostname
Buildfile: build.xml

hostname:
     [echo] Using ${env.HOSTNAME} for host name

BUILD SUCCESSFUL
Total time: 5 seconds



Not sure if any of this information helps, but here:

cruisecontrol@dev02
~/cruisecontrol/projects/webnew-dec2007/netsoft/webnew
$ uname -rsv
SunOS 5.10 Generic_125100-10

cruisecontrol@dev02
~/cruisecontrol/projects/webnew-dec2007/netsoft/webnew
$ echo $OSTYPE
solaris2.10


Thanks,
Barry


-----Original Message-----
From: Chuck Holzwarth [mailto:chuck_holzwarth@yahoo.com] 
Sent: Friday, January 04, 2008 3:03 PM
To: Ant Users List
Subject: Re: environment attribute

I just tried this on a Solaris VM on my desktop and HOSTNAME is not
defined by default. You may want to issue "export HOSTNAME=`hostname`"
in your .profile. Change this as appropriate for your shell.

Dominique Devienne 
    wrote: On 1/4/08, Barry Pape
wrote:
> Hopefully this is a quick and easy question.  Is the environment
> attribute of the property task supported on Solaris?

Yes.

> I've been trying
> to use ${env.HOSTNAME} but it doesn't appear to resolve.

Most likely because you have no such env. var. in your current shell.
Verify that using echo $HOSTNAME in the same shell you run Ant from.

Available env. vars varies by OS and shell usually. --DD

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




Thank you,
Chuck Holzwarth
(804) 403-3478 (home)
(540) 335-3171 (cell)
       
---------------------------------
Looking for last minute shopping deals?  Find them fast with Yahoo!
Search.

-----------------------------------------
Confidentiality Notice!
This electronic transmission and any attached documents or other
writings are confidential and are for the sole use of the intended
recipient(s) identified above. This message may contain information
that is privileged, confidential or otherwise protected from
disclosure under applicable law. If the receiver of this
information is not the intended recipient, or the employee, or
agent responsible for delivering the information to the intended
recipient, you are hereby notified that any use, reading,
dissemination, distribution, copying or storage of this information
is strictly prohibited. If you have received this information in
error, please notify the sender by return email and delete the
electronic transmission, including all attachments from your
system.


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




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.

RE: environment attribute

Posted by Barry Pape <bp...@netspend.com>.
Thanks for the feedback.

I verified that the HOSTNAME variable is set, but it doesn't get
resolved during the ant build.

cruisecontrol@dev02
~/cruisecontrol/projects/webnew-dec2007/netsoft/webnew
$ echo $HOSTNAME
dev02

cruisecontrol@dev02
~/cruisecontrol/projects/webnew-dec2007/netsoft/webnew
$ ant hostname
Buildfile: build.xml

hostname:
     [echo] Using ${env.HOSTNAME} for host name

BUILD SUCCESSFUL
Total time: 5 seconds



Not sure if any of this information helps, but here:

cruisecontrol@dev02
~/cruisecontrol/projects/webnew-dec2007/netsoft/webnew
$ uname -rsv
SunOS 5.10 Generic_125100-10

cruisecontrol@dev02
~/cruisecontrol/projects/webnew-dec2007/netsoft/webnew
$ echo $OSTYPE
solaris2.10


Thanks,
Barry


-----Original Message-----
From: Chuck Holzwarth [mailto:chuck_holzwarth@yahoo.com] 
Sent: Friday, January 04, 2008 3:03 PM
To: Ant Users List
Subject: Re: environment attribute

I just tried this on a Solaris VM on my desktop and HOSTNAME is not
defined by default. You may want to issue "export HOSTNAME=`hostname`"
in your .profile. Change this as appropriate for your shell.

Dominique Devienne <dd...@gmail.com> wrote: On 1/4/08, Barry Pape
wrote:
> Hopefully this is a quick and easy question.  Is the environment
> attribute of the property task supported on Solaris?

Yes.

> I've been trying
> to use ${env.HOSTNAME} but it doesn't appear to resolve.

Most likely because you have no such env. var. in your current shell.
Verify that using echo $HOSTNAME in the same shell you run Ant from.

Available env. vars varies by OS and shell usually. --DD

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




Thank you,
Chuck Holzwarth
(804) 403-3478 (home)
(540) 335-3171 (cell)
       
---------------------------------
Looking for last minute shopping deals?  Find them fast with Yahoo!
Search.

-----------------------------------------
Confidentiality Notice!
This electronic transmission and any attached documents or other
writings are confidential and are for the sole use of the intended
recipient(s) identified above. This message may contain information
that is privileged, confidential or otherwise protected from
disclosure under applicable law. If the receiver of this
information is not the intended recipient, or the employee, or
agent responsible for delivering the information to the intended
recipient, you are hereby notified that any use, reading,
dissemination, distribution, copying or storage of this information
is strictly prohibited. If you have received this information in
error, please notify the sender by return email and delete the
electronic transmission, including all attachments from your
system.


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


Re: environment attribute

Posted by Chuck Holzwarth <ch...@yahoo.com>.
I just tried this on a Solaris VM on my desktop and HOSTNAME is not defined by default. You may want to issue "export HOSTNAME=`hostname`" in your .profile. Change this as appropriate for your shell.

Dominique Devienne <dd...@gmail.com> wrote: On 1/4/08, Barry Pape  wrote:
> Hopefully this is a quick and easy question.  Is the environment
> attribute of the property task supported on Solaris?

Yes.

> I've been trying
> to use ${env.HOSTNAME} but it doesn't appear to resolve.

Most likely because you have no such env. var. in your current shell.
Verify that using echo $HOSTNAME in the same shell you run Ant from.

Available env. vars varies by OS and shell usually. --DD

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




Thank you,
Chuck Holzwarth
(804) 403-3478 (home)
(540) 335-3171 (cell)
       
---------------------------------
Looking for last minute shopping deals?  Find them fast with Yahoo! Search.

Re: environment attribute

Posted by Dominique Devienne <dd...@gmail.com>.
On 1/4/08, Barry Pape <bp...@netspend.com> wrote:
> Hopefully this is a quick and easy question.  Is the environment
> attribute of the property task supported on Solaris?

Yes.

> I've been trying
> to use ${env.HOSTNAME} but it doesn't appear to resolve.

Most likely because you have no such env. var. in your current shell.
Verify that using echo $HOSTNAME in the same shell you run Ant from.

Available env. vars varies by OS and shell usually. --DD

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