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 > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 10-03-2006
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,723
When you're inside a program, like ftp, scripts are not what you need. You can try
one of these ways to make it work:
one way:
Code:
echo "
verbose
open <remote_node>
user <username password>
lcd </path>
cd </remotepath>
pwd
get somefile
bye 
" | ftp
or with a here document
Code:
ftp remote_node <<EOF
user <username password>
lcd </path>
cd </remotepath>
pwd
get somefile
bye 
EOF
<<EOF marks the start, EOF marks the end of the here document.

If you are using ksh consider coprocesses - search the FAQ here for ftp.