I've got the following script that is not working. Trying to automate an ftp session. I've got a simple ls command in there to just see if I can get connected and do a file listing.
#!/bin/ksh -x
HOST='server01.domain.com'
USER='joe'
PASSWD='letmein'
ftp -inv $HOST << "EOF"
user $USER
$PASSWD
ls
bye
EOF
I fails at the user/pass. I've tried
user $USER $PASSWD
user $USER
pass $PASSWD
If I do it by hand, I get:
server22:/usr/local/bin # ftp server01
Connected to server01.domain.com.
220 server01 FTP server (Version 4.1 Tue May 15 16:38:46 CDT 2001) ready.
Name (server01:root): joe
331 Password required for joe.
Password: xxxxx
230 User joe logged in.
ftp> bye
221 Goodbye.
#!/bin/ksh -x
HOST='server01.domain.com'
USER='joe'
PASSWD='letmein'
ftp -inv $HOST << "EOF"
user $USER
$PASSWD
ls
bye
EOF
I fails at the user/pass. I've tried
user $USER $PASSWD
user $USER
pass $PASSWD
If I do it by hand, I get:
server22:/usr/local/bin # ftp server01
Connected to server01.domain.com.
220 server01 FTP server (Version 4.1 Tue May 15 16:38:46 CDT 2001) ready.
Name (server01:root): joe
331 Password required for joe.
Password: xxxxx
230 User joe logged in.
ftp> bye
221 Goodbye.