How to make ftp interact with sh-commands?

Lance R. Bailey lrb at rrivax.rri.uwo.ca
Wed Jul 25 17:04:45 AEST 1990


In article <23946 at adm.BRL.MIL>, xphyhofu%DDATHD21.BITNET at cunyvm.cuny.edu ( Joachim Holzfuss) writes...
>Hi, is there any wizard out there being able
>to shed some light on this?
> 
>I have to ftp files automatically from a directory,that grows
>permanently.
>Wat I did was:
>ftp> mget file.*
> ...
>Seems like ftp doesn't like me. Any good ideas?

what you need to do is ls file.* inlist and then use that to build a
list of ftp commands, or a ftp script. so you have one session to get,
you end it, build a script by prefixing all file names with get, the
whole file with open and user commands AND SUFFIXING THE FILE WITH A
CLOSE AND BYE. if you do not do that, many ftp implementations do not
recognize EOF as close and when you feed ftp with the script for
input, ftp goes into a tight/expensive forever-loop when the input
stops.

i implemented this using ftp as the tranport layer for uucico a
while ago and ran into the same problem. only i had a program that
talked to a popen to ftp, got the list, processed it and fed
the answers to ftp again. one session.

_________________________________
Lance R. Bailey, Systems Manager | Robarts Research Institute
email: lrb at rri.uwo.ca            | Clinical Trials Resources Group
  vox: 519-663-3787 ext. 4108    | P.O. Box 5015, 100 Perth Dr.
  fax: 519-663-3789              | London, Canada N6A 5K8



More information about the Comp.unix.wizards mailing list