Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!sdd.hp.com!caen!kuhub.cc.ukans.edu!maverick.ksu.ksu.edu!unlinfo.unl.edu!fergvax!231b3679 From: 231b3679@fergvax.unl.edu (Mike Gleason) Newsgroups: comp.unix.questions Subject: How to define macros in .netrc? Keywords: ftp .netrc Message-ID: <231b3679.673793060@fergvax> Date: 9 May 91 12:44:20 GMT Sender: news@unlinfo.unl.edu Organization: University of Nebraska - Lincoln Lines: 29 Nntp-Posting-Host: fergvax.unl.edu I have tasted the power in FTP's .netrc file but I want more. Right now I have my .netrc set up so it will log me in automatically whenever it finds a host defined in the .netrc. I was reading the manual for ftp and it says that you can also define macros along with everything else, and if you define a macro called 'init' it will execute that macro when you login. Here's what I would like to have for every site in my .netrc: machine rascal.ics.utexas.edu login anonymous password 231b3679@fergvax.unl.edu macdef init cd pub type i verbose ls -lrt You get the idea; basically I want it login and execute a few commands. My problem is that this doesn't work. Although the man page for ftp says it recognizes the 'macdef' option along with 'machine','login','password', and 'account', it DOESN'T! I know I am defining my macro right, because it works at the ftp command line. Whenever I try to login to the example above, ftp spits out a whole bunch of "Unrecognized .netrc keyword"s for macdef, cd pub, etc. A local guru around here suggested trying to use the 'command' keyword. I did try it, and this time ftp didn't barf on it, but it just ignored it. If anyone has figured out how to define startup macros in the .netrc, I would be grateful for an email! _mike gleason 231b3679@fergvax.unl.edu