ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Weintraub" <qazw...@gmail.com>
Subject Re: embed "if-then" in sshexec command question
Date Sun, 10 Feb 2008 18:48:19 GMT
You have to use the CSH syntax. You're using Bourne Shell syntax:

if (expr) then
...
else if (expr2) then
...
else
...
endif



On Feb 10, 2008 8:50 AM, Z W <mpc8250@gmail.com> wrote:
> Hi
>
> How do I embed a if-then statement inside sshexec knowing that the remote
> shell is a csh ?
> I keep getting this error:
>   [sshexec] if: Expression Syntax.
>   [sshexec] Remote command failed with exit status 1
>
>
>
> <sshexec host="${_hostname}"
>
> username="${_username}"
>
> password="${_password}"
>
> command="source .cshrc;
>
> cd ${_dir};
>
> pwd;
>
> test -d ${backup_dir};
>
> if [ $? -eq 1 ]
>
> then
>
> mkdir -p ${backup_dir};
>
> echo inside loop;
>
> fi;
>
> echo outside loop;
>
> mv -f ${data_dir}/* ${backup_dir};
>
> failonerror="false"
>
> output="output.txt"
>
> outputproperty="backup"
>
> timeout="0"
>
> trust="true"/>
>
> thanks
>



-- 
--
David Weintraub
qazwart@gmail.com

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


Mime
View raw message