Subject: Re: OFF TOPIC: Controlling ftp via ksh or csh
To: christophe plasschaert <cplasschaert@Geodis-overseas.fr>
From: Robert Elz <kre@munnari.OZ.AU>
List: netbsd-help
Date: 03/21/2000 13:53:40
    Date:        Mon, 20 Mar 2000 19:06:32 +0100
    From:        christophe plasschaert <cplasschaert@Geodis-overseas.fr>
    Message-ID:  <38D668A8.9C00B654@geodis-overseas.fr>

  | i am looking for a way of controlling ftp in a script shell ( i don't
  | want to use expect, in fact i can't). So if anybody has an idea of how
  | to do it it would be very helpful.

This is what I have done ...

/usr/bin/ftp -e -V -a munnari.oz.au <<'!'
prompt
binary
cd rfc
lcd rfc
mget *
lcd ../bcp
cd ../bcp
mget *
lcd ../std
[....]
!

If you don't want anon ftp, you can replace the -a with -n and use
"quote user NAME" "quote pass PASSWD" as the first two commands.
With a NetBSD client, the -e is essential (though it would be nicer
if it wasn't when stdin is not a terminal).   -V is optional.

kre