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.