Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Why does Linux kill my shell script after I do an ftp or lftp?

819570Apr 14 2011 — edited Apr 14 2011
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
This post has been answered by Tommy.Reynolds-Oracle on Apr 14 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 12 2011
Added on Apr 14 2011
9 comments
1,098 views