Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!ucdavis!csusac!scott From: scott@csusac.csus.edu (L. Scott Emmons) Newsgroups: comp.unix.questions Subject: Re: FTP Command input from file? Message-ID: <1990Jan9.045040.21028@csusac.csus.edu> Date: 9 Jan 90 04:50:40 GMT References: <991@manta.NOSC.MIL> Reply-To: scott@csusac.UUCP (L. Scott Emmons) Distribution: na Organization: California State University, Sacramento Lines: 40 In article <991@manta.NOSC.MIL> psm@manta.nosc.mil.UUCP (Scot Mcintosh) writes: >I want FTP to execute a canned set of commands from a >local file as though I had typed them from the console. You need to do two things to make this work. 1> set up a .netrc file in your home directory. The format is (At least on our flavor of unix, so you may wish to check documentation; but I don't expect it to be different...): machine login password for example, my .netrc entry for simtel20 is: machine simtel20.arpa login anonymous password guest 2> once the .netrc file is set up, you just redirect stdin into ftp from the file of commands, which MUST END WITH THE 'bye' COMMAND. for example if I wish to get the file "blather.tar-Z" from the "pd2:" directory, and let's say, deposit it in my local "ftp/unix/source" directory, my file would read: lcd ftp/unix/source cd pd2: tenex get blather.tar-Z bye and from the prompt: o% ftp simtel20.arpa