hi, The utility 'expect' is really, really cool for interactive work such as this. Though, it will be overkill, but an interesting subject! teve --- juergen.braukmann@ruhr-west.de wrote:
Martin Mielke wrote:
Dear all,
my idea to make an unattended FTP session looked
something like this:
#!/bin/sh
ftp -n $remote_site
cat << END
user mylogin pass mypass
[ more commands here ]
END
But it stops when it connects to the remote
server... so I must type the
user and passwd information...
I'm sure there must be a better way (wget does not fit my needs :-) ) but I remember seeing such unattended FTP sessions some time (years) ago...
Any suggestions are welcomed!
Martin
Hi Martin, well I cannot go round not to tell RTFM. have a look into "man ftp". There is a ".netrc" file in the users $HOME, or rather you're supposed to create it. When you do "ftp foo.bar.com", the default user and pw for foo.bar.com are in that file, thus not requiring authentication anymore. With that, you can script your download with a simple file:
myfile= ---8<--- binary cd /pub/linux/whatever lcd ~/download get foo.bar.tar.gz quit ---8<---
ftp < myfile
will do the work.
.netrc may look like: machine ftp.foo.de login juergen.braukmann password xxxxxxx default login anonymous password juergen.braukmann@foo.bar.de
enjoy!
Juergen
PS: .netrc should be set to 600 that *only* you can read it!
-- =========================================== __ _ Juergen Braukmann juergen.braukmann@gmx.de| -o)/ / (_)__ __ ____ __ Tel: 0201-743648 dk4jb@db0qs.#nrw.deu.eu | /\\ /__/ / _ \/ // /\ \/ / ===========================================_\_v __/_/_//_/\_,_/ /_/\_\
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq
__________________________________________________ Do You Yahoo!? Yahoo! Mail - Free email you can access from anywhere! http://mail.yahoo.com/ -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq