Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wotan!twisto!isis!max From: max@compaq.com (Max Heffler) Newsgroups: comp.unix.questions Subject: Re: How to define macros in .netrc? Keywords: ftp .netrc Message-ID: Date: 15 May 91 14:38:13 GMT References: <231b3679.673793060@fergvax> <43106@netnews.upenn.edu> Sender: news@twisto.compaq.com Lines: 41 pravin@eniac.seas.upenn.edu writes: >In a previous article max@compaq.com (Max Heffler) writes: >> >>The following works for me: >> >>machine oswego.oswego.edu login anonymous password max@compaq.com macdef init >>ls >> >>Maybe it has something to do with line continuation... >I get a segmentation fault, when I try putting macdef in? Any clues? From man page of ftp: macdef macro-name Define a macro. Subsequent lines are stored as the macro macro-name; a null line (consecutive NEWLINE characters in a file or RETURN characters from the ter- minal) terminates macro input mode. There is a limit of 16 macros and 4096 total characters in all defined macros. Macros remain defined until a close command is executed. The macro processor interprets `$' and `\' as special characters. A `$' followed by a number (or numbers) is replaced by the corresponding argument on the macro invocation command line. A `$' followed by an `i' sig- nals that macro processor that the executing macro is to be looped. On the first pass `$i' is replaced by the first argument on the macro invocation command line, on the second pass it is replaced by the second argument, and so on. A `\' followed by any character is replaced by that character. Use the `\' to prevent special treatment of the `$'. -- Max Heffler, Senior Software Engineer internet: max@compaq.com Compaq Computer Corporation uucp: ..!uunet!max@compaq.com P.O. Box 692000 - M050701 phone: (713) 378-8366 Houston, Texas 77269-2000 fax: (713) 374-7305