PDA

View Full Version : ftp shell script issue



closet geek
September 18th, 2006, 07:54 PM
Hi,

Why on earth does this code end up placing the file above the public_html direcory:

ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
cd public_html
put $FILE
quit
END_SCRIPT
exit 0

it definitely changed to public_html (as confirmed by pwd). Yet it *always* puts the file above the public_html.

Help!

cg

closet geek
September 20th, 2006, 04:24 PM
This was due to my $FILE variable being of the form '/file' which caused the FTP client to navigate to root.

cg