I want to automate a call to ftp in a shell script. If I type
$ftp somehost.domain.com
I am prompted for a username and password. I want to give that username and password as part of the call to ftp. The man page for ftp says I can issue a user command at the ftp prompt -- but I want to login to ftp all in one go. Is that possible? I don't see anything in the flags for ftp. I see that the -s option give me the option of specifying some ftp commands once I have the ftp prompt -- but I need to give the user name to get to the prompt...
expect
(a tcl/tk extension of sorts) is a program that's ideal for this sort of things - ie. wait for some prompt; give a reponse... wait for an answer; give a new response...expect
wait for "ogin:" and send you username, then it wait for "assword:" and send your password.