HI All,
I have created a unix script which takes 2 parameters and using sftp tranfers files to remote location
following is the script
#!/bin/ksh
#
#
# Parameter 1 is the complete path of the destination server
# Parameter 2 is the complete path of the file which is to be FTP
#-----------------------------------------------------------------
DEST_SERV=host@xxx.xxsftp.xx.com
FTP_STR=`sftp $DEST_SERV << EOF
echo $?
cd $1
echo $?
put $2
echo $?
quit
EOF`
echo --- $FTP_STR
i need to know the exit codes after each command is executed so tht i can trap it.
My problem is tht even if the put filename or directory path is invalid the exit code is returned as "0".
Can you pls help me.
Thanks a lot
Vikram.
****************