Hi Everybody,
I have the following script. It set as a cron job. It works fine if the file is present on the server, but if it is not, the script hangs.
How can I trap the failure and then exit from the script?
#! /bin/bash
# Get the new pgp files...
sftp
username@ftp4.server.com <<EOF
cd abc/ToScripNet
get abc*.txt.pgp
rm abc*.txt.pgp
!EOF
exit