environment

Description

Capture an environment variable or all environment variables.

If no name is specified, this type can be used where ever a map can be used.

If a name is specified, this type behaves like a simple value

Properties

NameDescriptionRequired
command The operating system specific command for returning an environment. Yes.
name The name of the environement varable. No, if not supplied then all are returned.

Example

Use environement to append the existing environment to an additional environment variable.

 <exec command="env">
   <environment>
     <value name="FRUIT" value="apple"/>
     <environment command="env"/>
   </variables>
   <environment/>
 </exec>
 

 <sequential>
   <variables id="vars">
     <environment name="FRUIT" command="env"/>
   </variables>
   <echo text="Todays fruit is ${vars.FRUIT}"/>
 </sequential>


(c) Rob Gordon 2005