Hi,
I've written a series of shell scripts that will log into a client site using ftp or lftp, get a data file , and then log out using quit and then EOF.
The script excerpt is as follows.
echo $PROGRAM_NAME - get
lftp -u $USER,$PASSWORD $HOST <<EOF
ls
cd outbound
ls
quit
EOF
################################################################################
### validate FTP ###
################################################################################
echo $PROGRAM_NAME - validate
if [ $? != 0 ];
then
echo "FAILURE - $FILE_NAME_DAT has failed FTP get." | mail -s "FAILURE - $PROGRAM_NAME" fhs_clientdata@focusedhs.com
exit 1
fi
So from what I have, the output will show the first echo, the output from the lftp session, and then the scripts abruptly ends.
It never makes to the second echo or for that matter the rest of the script. It just ends.
The strange part is that I've compared it to scripts that are identical for what functions are being performed and yet the other scripts will continue on after the lftp.
I've even brought it into MS Word and TextPad to look for hidden characters and they don't show any difference between script files with the error and script files with out it.
Does anyone have any ideas?
Thanks