[ Attached Message ]
From: | |
To: | |
Date: | Thu, 26 Feb 1998 08:28:33 +0100 |
Local: | Thurs, Feb 26 1998 2:28 am |
Subject: | Re: simple question? |
> site
> and ftp a file from dir /pub/log to my cwd and quit from there.
> i use following but it doesn't work:
> #!/bin/sh
> ftp 131.104.112.4
> anonymous
> cd /pub/log
> get README
> quit
shell-skripts.Perl and other scripting languages will probably help too
Here's a small perl-script
#!/usr/bin/perl -w
use Net::FTP
$hostname='131.104.112.4';
$user='anonymous';
$ftp_path='/pub/log';
$file_to_get='README';
# new object
$ftp=Net::Ftp->new($hostname);
# ftp login
$ftp->login($user, $password);
# change directory
$ftp->cwd($ftp_path);
# get the file
$ftp->get($file_to_get);
#quit the session
$ftp->quit;
I'm not quite sure if this really works, but a simular programm should
do.
Best regards
Friedrich