ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francis GALIEGUE <...@one2team.com>
Subject Re: Setting Property to a path containing Space
Date Thu, 22 Oct 2009 11:41:53 GMT
On Thu, Oct 22, 2009 at 13:27, Rohit P <rohitmp.for@gmail.com> wrote:
> Hi,
>
> I have a requirement to execute a program that uses a path as an argument.
> The path argument is set using <property> task.
>
>    <property name="SpaceVar" value="C:/Program Files"/>
>
>    <target name="EchoVar">
>           <echo> SpaceVar = ${SpaceVar} </echo>
>           <exec dir="${basedir}" executable="cmd.exe" failonerror="true">
>               <arg line="/c dir ${SpaceVar}"/>
>           </exec>
>
>    </target>
>
> After execution of the above snippet i am getting the below error:
>

Don't use <arg line="">, as it will split the line attribute with spaces.

Use:
    <arg value="/c"/>
    <arg value="dir"/>
    <arg value="${SpaceVar}"/>


-- 

Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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


Mime
View raw message