On Sat, 21 Mar 1998, Dave Ihnat wrote:
>Norberto Grassi wrote:
>> I need to create a shell script in order to do ftp downloads during the
>> night (using crontab).
>>
>> The point is:
>> how can I pass all the cd's and gets to the ftp command from inside the
>> script?
>
>Redirect input.  For instance, within the script you gave, simply write it
>as:
>
>ftp ftp.any.com <<!
>cd 1/2/3
>get filename
>!

Ich.  Using an exclamation mark (!) to mark the end of the here document
rubs my aesthetic never.  I'd instead use something a little more
description and easy to see, such as "EOF".

You also didn't suggest a method for authenticating yourself, which is
necessary even under anonymous FTP:

ftp -n ftp.any.com <<EOT > myfile
user anonymous ${USER}@
cd 1/2/3
get filename
quit
EOT

Whatever the case, an easier solution might be to use Lynx:

    lynx -source ftp://ftp.any.com/1/2/3/filename > myfile

-- 
    Steve Coile
 [EMAIL PROTECTED]


-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
         To unsubscribe: mail [EMAIL PROTECTED] with 
                       "unsubscribe" as the Subject.

Reply via email to