remotePath=$1
fileName=$2
remoteUser=$3
remoteServer=$4
echo " if [ -r $remotePath/$fileName ]; then echo '0'; else echo '1'; fi " > temp_command.log
command1=`cat temp_command.log`
ssh $remoteUser@$remoteServer $command1
rm temp_command.log
Above code is to check whether the file in remote server is exist. It was done by using "ssh".
Due to requirement constraint, I am not allowed to use "ssh". I have to use "sftp".
Is it possible to check whether the remote file is exist or not by using "sftp" ?
Thanks..