[buug] ftp in shell script
Ian Zimmerman
itz at speakeasy.org
Mon Sep 9 12:21:59 PDT 2002
Pong-TC> Hello All I am very new with UNIX. I am trying to include
Pong-TC> ftp commands in my shell script, but it is not successful
Pong-TC> yet. I want to ftp and grab files from another host, and
Pong-TC> then run other commands in the script file.
Pong-TC> The problem is that it always asks me to put my login and
Pong-TC> password. It didn't automatically go through as I wish. Can
Pong-TC> anyone please help?
There are many answers to this. One is a more featureful ftp client,
as others have suggested. But even the stock ftp client (at least the
one that has been in every Linux distribution for a decade :) can use
a .netrc file in your home directory to look up the password. "man
ftp" should explain the format.
A more general solution is to write an Expect script. In fact the
Expect distribution comes with many example scripts, some of which do
exactly this, and much more.
--
Ian Zimmerman, Oakland, California, U.S.A.
GPG: 433BA087 9C0F 194F 203A 63F7 B1B8 6E5A 8CA3 27DB 433B A087
EngSoc adopts market economy: cheap is wasteful, efficient is expensive.
More information about the buug
mailing list