The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: FTP Problem
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 06-06-2008
jaduks's Avatar
jaduks jaduks is offline
Registered User
  
 

Join Date: Aug 2007
Location: Assam,India
Posts: 166
Your script looks good to me.

Code:
ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
put $FILE
quit
END_SCRIPT
Don't confuse with END_SCRIPT , as its just a eof corresponding to the previous <<END_SCRIPT entry in the "ftp -n .." line. You can use any tag.
Since you are doing "put $FILE", the file will be transferred(put to the remote $HOST) provided the ftp connection is proper(ftp credentials) and $FILE is present in the dir from where you are running this script. Hope this helps.

//Jadu