I'm trying to trap errors in a shell script executing an sftp command this way:
/usr/bin/sftp $FTP\_USER@$FTP_SERVER <<EOF> $HOME/$ERR_FILE
cd $FTP_DIR
put $FILE_NAME
bye
EOF
I expect errors to be recorded in $ERR_FILE but they are not. The only thing in the $ERR_FILE is:
sftp> sftp> sftp>
Thank you