standard input to commands in a shell script

Michael Meissner meissner at osf.org
Sat Oct 13 05:28:54 AEST 1990


In article <BARNETT.90Oct12133123 at grymoire.crd.ge.com>
barnett at grymoire.crd.ge.com (Bruce Barnett) writes:

| >   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

(echo "user anonymous"; echo "${USER-${LOGNAME}}@`hostname`"; echo dir; echo quit) | \
	ftp uunet.uu.net
--
Michael Meissner	email: meissner at osf.org		phone: 617-621-8861
Open Software Foundation, 11 Cambridge Center, Cambridge, MA, 02142

Do apple growers tell their kids money doesn't grow on bushes?



More information about the Comp.unix.shell mailing list