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 <[EMAIL PROTECTED]> 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 [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]