standard input to commands in a shell script

Bruce Barnett barnett at grymoire.crd.ge.com
Sat Oct 13 03:31:23 AEST 1990


>   In article <1990Oct12.025833.13376 at cubmol.bio.columbia.edu> ping at cubmol.bio.columbia.edu (Shiping Zhang) writes:

>>ftp genbank.bio.net << END
>>ftp
>>ident
>>ls
>>quit
>>END

In article <7219 at muffin.cme.nist.gov> libes at cme.nist.gov (Don Libes) writes:

>The problem is that ftp (as do most programs) reads passwords from
>/dev/tty, ignoring your i/o redirection.  There is no shell mechanism
>to get around this. 

News to me. I have always done this, which works fine.

set HOST=`hostname`
set SOURCE=machine.edu
set temp=/tmp/file
ftp -n $SOURCE <<END
user anonymous $HOST
get pub/file $temp
quit
END
--
Bruce G. Barnett	barnett at crd.ge.com	uunet!crdgw1!barnett



More information about the Comp.unix.shell mailing list