On Tue, 25 Jun 2002, Joel Schneider wrote:

> On Tue, Jun 25, 2002 at 10:03:38PM -0500, Doug wrote:
> > I know I've done this in windows so I'm assuming it's possible in Linux
> > as well. I'd like to set up an automated ftp job to send a file. Can the
> > command line ftp in linux do this or do I need another tool? I looked at
> > it a bit earlier and couldn't really find anything on doing this (man
> > ftp etc...) or did I just miss something???
> 
> man expect
> 
> or, if expect isn't already on your system, see the web page:
> 
> http://expect.nist.gov/
> 
> or, if you prefer Perl, maybe use libwww-perl:
> 
> perldoc LWP
> 

Why do all this for a simple ftp script? KISS.

#!/bin/sh

HOST="ftpserver"
USER="username password"
export HOST USER
/usr/bin/ftp -n <<-+++
        open $HOST
        user $USER
        get remotefile.txt localfile.txt
        quit
+++