Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: mark@cita.toronto.edu (Mark Bartelt)
Subject: Re: Help - I'm stuck in FTP and I can't get up
Date: 1998/02/03	[thread overview]
Message-ID: <EntFuA.21D@utcc.utoronto.ca> (raw)
In-Reply-To: 34D6159B.3B45@pangea.stanford.edu


Newsgroups: comp.unix.osf.osf1
Subject: Re: Help - I'm stuck in FTP and I can't get up
References: <6atsao$imb$1@newsbell.bellglobal.com> <6b1ori$l1k@eliot.oit.umass.edu> <34D6159B.3B45@pangea.stanford.edu>
Organization: Canadian Institute for Theoretical Astrophysics
Reply-To: mark@cita.utoronto.ca

[ Phil Farrell ]

>>  This kind of script generally does not work well because the commands are fed
>>  to ftp without waiting for any responses.  Ftp may or may not correctly queue
>>  up the commands and execute them.  I prefer a shell script that explicitly
>>  waits between commands by using a subshell to echo the commands to a pipe into
>>  the ftp program, e.g,
>>
>>       #! /bin/sh
>>
>>       (echo "user username password"; sleep 15; echo "cd directory"; \
>>          sleep 15; echo "put file"; sleep 15; echo "quit" ) | ftp -n somehost
>>
>>  You would adjust the "sleep" times (in seconds) so they will be long enough to
>>  encompass any delay that might occur on your systems or network.

Um, rather than kludging around with adjusting "sleep" times to anticipate delays
that are, by definition, unpredicatble, wouldn't it be preferable to use "expect"?
After all, isn't that exactly what it was designed for (i.e. automating the use of
tools which were originally designed to be used interactively)?

Mark Bartelt                                                          416/978-5619
Canadian Institute for                                       mark@cita.utoronto.ca
Theoretical Astrophysics                         http://www.cita.utoronto.ca/~mark

"Sheep not busy being shorn are busy frying"    --    Dylan, at a NZ lamb barbecue
               [ singing "It's all right, ma (I'm only bleating)" ]



  parent reply	other threads:[~1998-02-03  5:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-01-30  5:00 Help - I'm stuck in FTP and I can't get up Andrew Butchart
     [not found] ` <6b1ori$l1k@eliot.oit.umass.edu>
1998-02-02  5:00   ` Phil Farrell
1998-02-03  5:00     ` Nick Dokos
1998-02-03  5:00     ` Mark Bartelt [this message]
1998-02-08  5:00   ` Cameron Laird
1998-02-09  5:00 ` Kylan Coghlan
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox