For anyone else who reads this thread, the proper script should be:
#!/bin/ksh
userString="brsgadmin"
pswdString="brsg6906"
#ifmsdir="NSPPRO_USR1:[USERS.IFMS.BRSGADMIN]"
ifmsfile="COPY_DB_STATUS.DAT"
ftp -in ba0470.optus.com.au <<-END_FTP
user $userString $pswdString
get ${ifmsfile}
quit
END_FTP
echo "file transfer has completed"
date
where "-END_FTP" at the end is changed to "END_FTP" (without the "-" character)
Quote:
Originally posted by adokli
FTP script problem
I'm new unix enviroment, and I have mamnaged to wrote a script to ftp a file from a remote machine.
My problem when the ftp has executed all other lines in the script are ignored and script exits. The message "file transfer has completed" is not displayed and date . Below is my sample script.
Please tell me what I am doing wrong here.
#!/bin/ksh
userString="brsgadmin"
pswdString="brsg6906"
#ifmsdir="NSPPRO_USR1:[USERS.IFMS.BRSGADMIN]"
ifmsfile="COPY_DB_STATUS.DAT"
ftp -in ba0470.optus.com.au <<-END_FTP
user $userString $pswdString
get ${ifmsfile}
quit
-END_FTP
echo "file transfer has completed"
date
|