From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,189746606d0bae92 X-Google-Attributes: gidfee84,public 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 Message-ID: #1/1 X-Deja-AN: 321756210 Sender: nntp@utcc.utoronto.ca (News) X-Nntp-Posting-Host: rorqual.cita.utoronto.ca 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 Newsgroups: comp.unix.osf.osf1 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)" ]