fixed order of tgoto args, zapped reliance on former isprint bug
[unix-history] / usr / src / usr.bin / ftp / ftp.1
... / ...
CommitLineData
1.\" Copyright (c) 1985 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms are permitted
5.\" provided that the above copyright notice and this paragraph are
6.\" duplicated in all such forms and that any documentation,
7.\" advertising materials, and other materials related to such
8.\" distribution and use acknowledge that the software was developed
9.\" by the University of California, Berkeley. The name of the
10.\" University may not be used to endorse or promote products derived
11.\" from this software without specific prior written permission.
12.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
14.\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
15.\"
16.\" @(#)ftp.1 6.10 (Berkeley) %G%
17.\"
18.TH FTP 1 ""
19.UC 5
20.SH NAME
21ftp \- ARPANET file transfer program
22.SH SYNOPSIS
23.B ftp
24[
25.B \-v
26] [
27.B \-d
28] [
29.B \-i
30] [
31.B \-n
32] [
33.B \-g
34] [
35.B host
36]
37.SH DESCRIPTION
38.I Ftp
39is the user interface to the ARPANET standard File Transfer Protocol.
40The program allows a user to transfer files to and from a
41remote network site.
42.PP
43The client host with which
44.I ftp
45is to communicate may be specified on the command line.
46If this is done,
47.I ftp
48will immediately attempt to establish a connection to an FTP
49server on that host; otherwise,
50.I ftp
51will enter its command interpreter and await instructions
52from the user. When
53.I ftp
54is awaiting commands from the user the prompt \*(lqftp>\*(rq
55is provided to the user. The following commands are recognized
56by
57.IR ftp :
58.TP
59\fB\&!\fP [ \fIcommand\fP [ \fIargs\fP ] ]
60Invoke an interactive shell on the local machine.
61If there are arguments, the first is taken to be a command to execute
62directly, with the rest of the arguments as its arguments.
63.TP
64\fB\&$\fP \fImacro-name\fP [ \fIargs\fP ]
65Execute the macro \fImacro-name\fP that was defined with the
66\fBmacdef\fP command.
67Arguments are passed to the macro unglobbed.
68.TP
69\fBaccount\fP [ \fIpasswd\fP ]
70Supply a supplemental password required by a remote system for access
71to resources once a login has been successfully completed.
72If no argument is included, the user will be prompted for an account
73password in a non-echoing input mode.
74.TP
75\fBappend\fP \fIlocal-file\fP [ \fIremote-file\fP ]
76Append a local file to a file on the remote machine. If
77.I remote-file
78is left unspecified, the local file name is used in naming the
79remote file after being altered by any
80.I ntrans
81or
82.I nmap
83setting.
84File transfer uses the current settings for
85.IR type ,
86.IR format ,
87.IR mode ,
88and
89.IR structure .
90.TP
91.B ascii
92Set the file transfer
93.I type
94to network ASCII. This is the default type.
95.TP
96.B bell
97Arrange that a bell be sounded after each file transfer
98command is completed.
99.TP
100.B binary
101Set the file transfer
102.I type
103to support binary image transfer.
104.TP
105.B bye
106Terminate the FTP session with the remote server
107and exit
108.IR ftp .
109An end of file will also terminate the session and exit.
110.TP
111.B case
112Toggle remote computer file name case mapping during
113.B mget
114commands.
115When
116.B case
117is on (default is off), remote computer file names with all letters in
118upper case are written in the local directory with the letters mapped
119to lower case.
120.TP
121.BI cd " remote-directory"
122Change the working directory on the remote machine
123to
124.IR remote-directory .
125.TP
126.B cdup
127Change the remote machine working directory to the parent of the
128current remote machine working directory.
129.TP
130.B close
131Terminate the FTP session with the remote server, and
132return to the command interpreter.
133Any defined macros are erased.
134.TP
135.B cr
136Toggle carriage return stripping during
137ascii type file retrieval.
138Records are denoted by a carriage return/linefeed sequence
139during ascii type file transfer.
140When
141.B cr
142is on (the default), carriage returns are stripped from this
143sequence to conform with the UNIX single linefeed record
144delimiter.
145Records on non-UNIX remote systems may contain single linefeeds;
146when an ascii type transfer is made, these linefeeds may be
147distinguished from a record delimiter only when
148.B cr
149is off.
150.TP
151.BI delete " remote-file"
152Delete the file
153.I remote-file
154on the remote machine.
155.TP
156\fBdebug\fP [ \fIdebug-value\fP ]
157Toggle debugging mode. If an optional
158.I debug-value
159is specified it is used to set the debugging level.
160When debugging is on,
161.I ftp
162prints each command sent to the remote machine, preceded
163by the string \*(lq-->\*(rq.
164.TP
165\fBdir\fP [ \fIremote-directory\fP ] [ \fIlocal-file\fP ]
166Print a listing of the directory contents in the
167directory,
168.IR remote-directory ,
169and, optionally, placing the output in
170.IR local-file .
171If interactive prompting is on,
172.I ftp
173will prompt the user to verify that the last argument is indeed the
174target local file for receiving
175.B dir
176output.
177If no directory is specified, the current working
178directory on the remote machine is used. If no local
179file is specified, or \fIlocal-file\fP is \fB-\fP,
180output comes to the terminal.
181.TP
182.B disconnect
183A synonym for
184.BR close .
185.TP
186.BI form " format"
187Set the file transfer
188.I form
189to
190.IR format .
191The default format is \*(lqfile\*(rq.
192.TP
193\fBget\fP \fIremote-file\fP [ \fIlocal-file\fP ]
194Retrieve the
195.I remote-file
196and store it on the local machine. If the local
197file name is not specified, it is given the same
198name it has on the remote machine, subject to
199alteration by the current
200.IR case ,
201.IR ntrans ,
202and
203.I nmap
204settings.
205The current settings for
206.IR type ,
207.IR form ,
208.IR mode ,
209and
210.I structure
211are used while transferring the file.
212.TP
213\fBglob\fP
214Toggle filename expansion for \fBmdelete\fP, \fBmget\fP and \fBmput\fP.
215If globbing is turned off with \fBglob\fP, the file name arguments
216are taken literally and not expanded.
217Globbing for \fBmput\fP is done as in \fBcsh\fP(1).
218For \fBmdelete\fP and \fBmget\fP, each remote file name is expanded
219separately on the remote machine and the lists are not merged.
220Expansion of a directory name is likely to be
221different from expansion of the name of an ordinary file:
222the exact result depends on the foreign operating system and ftp server,
223and can be previewed by doing `\fBmls\fP\ \fIremote-files\fP\ \fB-\fP'.
224Note: \fBmget\fP and \fBmput\fP are not meant to transfer
225entire directory subtrees of files. That can be done by
226transferring a \fBtar\fP(1) archive of the subtree (in binary mode).
227.TP
228\fBhash\f
229Toggle hash-sign (``#'') printing for each data block
230transferred. The size of a data block is 1024 bytes.
231.TP
232\fBhelp\fP [ \fIcommand\fP ]
233Print an informative message about the meaning of
234.IR command .
235If no argument is given,
236.I ftp
237prints a list of the known commands.
238.TP
239\fBlcd\fP [ \fIdirectory\fP ]
240Change the working directory on the local machine. If
241no
242.I directory
243is specified, the user's home directory is used.
244.TP
245\fBls\fP [ \fIremote-directory\fP ] [ \fIlocal-file\fP ]
246Print an abbreviated listing of the contents of a
247directory on the remote machine. If
248.I remote-directory
249is left unspecified, the current working directory is used.
250If interactive prompting is on,
251.I ftp
252will prompt the user to verify that the last argument is indeed the
253target local file for receiving
254.B ls
255output.
256If no local file is specified, or if \fIlocal-file\fR is \fB-\fR,
257the output is sent to the terminal.
258.TP
259\fBmacdef\fP \fImacro-name\fP
260Define a macro.
261Subsequent lines are stored as the macro
262\fImacro-name\fP; a null line (consecutive newline characters
263in a file or
264carriage returns from the terminal) terminates macro input mode.
265There is a limit of 16 macros and 4096 total characters in all
266defined macros.
267Macros remain defined until a
268.B close
269command is executed.
270The macro processor interprets '$' and '\\' as special characters.
271A '$' followed by a number (or numbers) is replaced by the
272corresponding argument on the macro invocation command line.
273A '$' followed by an 'i' signals that macro processor that the
274executing macro is to be looped. On the first pass '$i' is
275replaced by the first argument on the macro invocation command line,
276on the second pass it is replaced by the second argument, and so on.
277A '\\' followed by any character is replaced by that character.
278Use the '\\' to prevent special treatment of the '$'.
279.TP
280\fBmdelete\fP [ \fIremote-files\fP ]
281Delete the \fIremote-files\fP on the remote machine.
282.TP
283\fBmdir\fP \fIremote-files\fP \fIlocal-file\fP
284Like \fBdir\fP, except multiple remote files may be specified.
285If interactive prompting is on,
286.I ftp
287will prompt the user to verify that the last argument is indeed the
288target local file for receiving
289.B mdir
290output.
291.TP
292\fBmget\fP \fIremote-files\fP
293Expand the \fIremote-files\fP on the remote machine
294and do a \fBget\fP for each file name thus produced.
295See \fBglob\fR for details on the filename expansion.
296Resulting file names will then be processed according to
297.IR case ,
298.IR ntrans ,
299and
300.I nmap
301settings.
302Files are transferred into the local working directory,
303which can be changed with `\fBlcd\fP\ directory';
304new local directories can be created with `\fB!\fP\ mkdir\ directory'.
305.TP
306\fBmkdir\fP \fIdirectory-name\fP
307Make a directory on the remote machine.
308.TP
309\fBmls\fP \fIremote-files\fP \fIlocal-file\fP
310Like \fBls\fP, except multiple remote files may be specified.
311If interactive prompting is on,
312.I ftp
313will prompt the user to verify that the last argument is indeed the
314target local file for receiving
315.B mls
316output.
317.TP
318\fBmode\fP [ \fImode-name\fP ]
319Set the file transfer
320.I mode
321to
322.IR mode-name .
323The default mode is \*(lqstream\*(rq mode.
324.TP
325\fBmput\fP \fIlocal-files\fP
326Expand wild cards in the list of local files given as arguments
327and do a \fBput\fR for each file in the resulting list.
328See \fBglob\fP for details of filename expansion.
329Resulting file names will then be processed according to
330.I ntrans
331and
332.I nmap
333settings.
334.TP
335\fBnmap\fP [ \fIinpattern\fP \fIoutpattern\fP ]
336Set or unset the filename mapping mechanism.
337If no arguments are specified, the filename mapping mechanism is unset.
338If arguments are specified, remote filenames are mapped during
339.B mput
340commands and
341.B put
342commands issued without a specified remote target filename.
343If arguments are specified, local filenames are mapped during
344.B mget
345commands and
346.B get
347commands issued without a specified local target filename.
348This command is useful when connecting to a non-UNIX remote computer
349with different file naming conventions or practices.
350The mapping follows the pattern set by
351.I inpattern
352and
353.IR outpattern .
354.I Inpattern
355is a template for incoming filenames (which may have already been
356processed according to the
357.B ntrans
358and
359.B case
360settings).
361Variable templating is accomplished by including the sequences '$1', '$2', ..., '$9' in
362.IR inpattern .
363Use '\\' to prevent this special treatment of the '$' character.
364All other characters are treated literally, and are used to determine the
365.B nmap
366.I inpattern
367variable values.
368For exmaple, given
369.I inpattern
370$1.$2 and the remote file name "mydata.data", $1 would have the value
371"mydata", and $2 would have the value "data".
372The
373.I outpattern
374determines the resulting mapped filename.
375The sequences '$1', '$2', ...., '$9' are replaced by any value resulting
376from the
377.I inpattern
378template.
379The sequence '$0' is replace by the original filename.
380Additionally, the sequence '[\fIseq1\fP,\fIseq2\f\P]' is replaced by
381.I seq1
382if
383.I seq1
384is not a null string; otherwise it is replaced by
385.IR seq2 .
386For example, the command "nmap $1.$2.$3 [$1,$2].[$2,file]" would yield
387the output filename "myfile.data" for input filenames "myfile.data" and
388"myfile.data.old", "myfile.file" for the input filename "myfile", and
389"myfile.myfile" for the input filename ".myfile".
390Spaces may be included in
391.IR outpattern ,
392as in the example: nmap $1 |sed "s/ *$//" > $1 .
393Use the '\\' character to prevent special treatment
394of the '$', '[', ']', and ',' characters.
395.TP
396\fBntrans\fP [ \fIinchars\fP [ \fIoutchars\fP ] ]
397Set or unset the filename character translation mechanism.
398If no arguments are specified, the filename character
399translation mechanism is unset.
400If arguments are specified, characters in
401remote filenames are translated during
402.B mput
403commands and
404.B put
405commands issued without a specified remote target filename.
406If arguments are specified, characters in
407local filenames are translated during
408.B mget
409commands and
410.B get
411commands issued without a specified local target filename.
412This command is useful when connecting to a non-UNIX remote computer
413with different file naming conventions or practices.
414Characters in a filename matching a character in
415.I inchars
416are replaced with the corresponding character in
417.IR outchars .
418If the character's position in
419.I inchars
420is longer than the length of
421.IR outchars ,
422the character is deleted from the file name.
423.TP
424\fBopen\fP \fIhost\fP [ \fIport\fP ]
425Establish a connection to the specified
426.I host
427FTP server. An optional port number may be supplied,
428in which case,
429.I ftp
430will attempt to contact an FTP server at that port.
431If the
432.I auto-login
433option is on (default),
434.I ftp
435will also attempt to automatically log the user in to
436the FTP server (see below).
437.TP
438.B prompt
439Toggle interactive prompting. Interactive prompting
440occurs during multiple file transfers to allow the
441user to selectively retrieve or store files.
442If prompting is turned off (default is on), any \fBmget\fP or \fBmput\fP
443will transfer all files, and any \fBmdelete\fP will delete all files.
444.TP
445\fBproxy\fP \fIftp-command\fP
446Execute an ftp command on a secondary control connection.
447This command allows simultaneous connection to two remote ftp
448servers for transferring files between the two servers.
449The first
450.B proxy
451command should be an
452.BR open ,
453to establish the secondary control connection.
454Enter the command "proxy ?" to see other ftp commands executable on the
455secondary connection.
456The following commands behave differently when prefaced by
457.BR proxy :
458.B open
459will not define new macros during the auto-login process,
460.B close
461will not erase existing macro definitions,
462.B get
463and
464.B mget
465transfer files from the host on the primary control connection
466to the host on the secondary control connection, and
467.BR put ,
468.BR mput ,
469and
470.B append
471transfer files from the host on the secondary control connection
472to the host on the primary control connection.
473Third party file transfers depend upon support of the ftp protocol
474PASV command by the server on the secondary control connection.
475.TP
476\fBput\fP \fIlocal-file\fP [ \fIremote-file\fP ]
477Store a local file on the remote machine. If
478.I remote-file
479is left unspecified, the local file name is used
480after processing according to any
481.I ntrans
482or
483.I nmap
484settings
485in naming the remote file. File transfer uses the
486current settings for
487.IR type ,
488.IR format ,
489.IR mode ,
490and
491.IR structure .
492.TP
493.B pwd
494Print the name of the current working directory on the remote
495machine.
496.TP
497.B quit
498A synonym for
499.BR bye .
500.TP
501.BI quote " arg1 arg2 ..."
502The arguments specified are sent, verbatim, to the remote FTP
503server.
504.TP
505\fBrecv\fP \fIremote-file\fP [ \fIlocal-file\fP ]
506A synonym for get.
507.TP
508\fBremotehelp\fP [ \fIcommand-name\fP ]
509Request help from the remote FTP server. If a
510.I command-name
511is specified it is supplied to the server as well.
512.TP
513\fBrename\fP [ \fIfrom\fP ] [ \fIto\fP ]
514Rename the file
515.I from
516on the remote machine, to the file
517.IR to .
518.TP
519.B reset
520Clear reply queue.
521This command re-synchronizes command/reply sequencing with the remote
522ftp server.
523Resynchronization may be neccesary following a violation of the ftp protocol
524by the remote server.
525.TP
526.BI rmdir " directory-name"
527Delete a directory on the remote machine.
528.TP
529.B runique
530Toggle storing of files on the local system with unique filenames.
531If a file already exists with a name equal to the target
532local filename for a
533.B get
534or
535.B mget
536command, a ".1" is appended to the name.
537If the resulting name matches another existing file,
538a ".2" is appended to the original name.
539If this process continues up to ".99", an error
540message is printed, and the transfer does not take place.
541The generated unique filename will be reported.
542Note that
543.B runique
544will not affect local files generated from a shell command
545(see below).
546The default value is off.
547.TP
548\fBsend\fP \fIlocal-file\fP [ \fIremote-file\fP ]
549A synonym for put.
550.TP
551.B sendport
552Toggle the use of PORT commands. By default,
553.I ftp
554will attempt to use a PORT command when establishing
555a connection for each data transfer.
556The use of PORT commands can prevent delays
557when performing multiple file transfers. If the PORT
558command fails,
559.I ftp
560will use the default data port. When the use of PORT
561commands is disabled, no attempt will be made to use
562PORT commands for each data transfer. This is useful
563for certain FTP implementations which do ignore PORT
564commands but, incorrectly, indicate they've been accepted.
565.TP
566.B status
567Show the current status of
568.IR ftp .
569.TP
570\fBstruct\fP [ \fIstruct-name\fP ]
571Set the file transfer
572.I structure
573to
574.IR struct-name .
575By default \*(lqstream\*(rq structure is used.
576.TP
577.B sunique
578Toggle storing of files on remote machine under unique file names.
579Remote ftp server must support ftp protocol STOU command for
580successful completion.
581The remote server will report unique name.
582Default value is off.
583.TP
584.B tenex
585Set the file transfer type to that needed to
586talk to TENEX machines.
587.TP
588.B trace
589Toggle packet tracing.
590.TP
591\fBtype\fP [ \fItype-name\fP ]
592Set the file transfer
593.I type
594to
595.IR type-name .
596If no type is specified, the current type
597is printed. The default type is network ASCII.
598.TP
599\fBuser\fP \fIuser-name\fP [ \fIpassword\fP ] [ \fIaccount\fP ]
600Identify yourself to the remote FTP server. If the
601password is not specified and the server requires it,
602.I ftp
603will prompt the user for it (after disabling local echo).
604If an account field is not specified, and the FTP server
605requires it, the user will be prompted for it.
606If an account field is specified, an account command will
607be relayed to the remote server after the login sequence
608is completed if the remote server did not require it
609for logging in.
610Unless
611.I ftp
612is invoked with \*(lqauto-login\*(rq disabled, this
613process is done automatically on initial connection to
614the FTP server.
615.TP
616.B verbose
617Toggle verbose mode. In verbose mode, all responses from
618the FTP server are displayed to the user. In addition,
619if verbose is on, when a file transfer completes, statistics
620regarding the efficiency of the transfer are reported. By default,
621verbose is on.
622.TP
623\fB?\fP [ \fIcommand\fP ]
624A synonym for help.
625.PP
626Command arguments which have embedded spaces may be quoted with
627quote (") marks.
628.SH "ABORTING A FILE TRANSFER"
629To abort a file transfer, use the terminal interrupt key
630(usually Ctrl-C).
631Sending transfers will be immediately halted.
632Receiving transfers will be halted by sending a ftp protocol ABOR
633command to the remote server, and discarding any further data received.
634The speed at which this is accomplished depends upon the remote
635server's support for ABOR processing.
636If the remote server does not support the ABOR command, an "ftp>"
637prompt will not appear until the remote server has completed
638sending the requested file.
639.PP
640The terminal interrupt key sequence will be ignored when
641.I ftp
642has completed any local processing and is awaiting a reply
643from the remote server.
644A long delay in this mode may result from the ABOR processing described
645above, or from unexpected behavior by the remote server, including
646violations of the ftp protocol.
647If the delay results from unexpected remote server behavior, the local
648.I ftp
649program must be killed by hand.
650.SH "FILE NAMING CONVENTIONS"
651Files specified as arguments to
652.I ftp
653commands are processed according to the following rules.
654.TP
6551)
656If the file name \*(lq\-\*(rq is specified, the
657.B stdin
658(for reading) or
659.B stdout
660(for writing) is used.
661.TP
6622)
663If the first character of the file name is \*(lq|\*(rq, the
664remainder of the argument is interpreted as a shell command.
665.I Ftp
666then forks a shell, using
667.IR popen (3)
668with the argument supplied, and reads (writes) from the stdout
669(stdin). If the shell command includes spaces, the argument
670must be quoted; e.g. \*(lq"| ls -lt"\*(rq. A particularly
671useful example of this mechanism is: \*(lqdir |more\*(rq.
672.TP
6733)
674Failing the above checks, if ``globbing'' is enabled,
675local file names are expanded
676according to the rules used in the
677.IR csh (1);
678c.f. the
679.I glob
680command.
681If the
682.I ftp
683command expects a single local file ( .e.g.
684.BR put ),
685only the first filename generated by the "globbing" operation is used.
686.TP
6874)
688For
689.B mget
690commands and
691.B get
692commands with unspecified local file names, the local filename is
693the remote filename, which may be altered by a
694.BR case ,
695.BR ntrans ,
696or
697.B nmap
698setting.
699The resulting filename may then be altered if
700.B runique
701is on.
702.TP
7035)
704For
705.B mput
706commands and
707.B put
708commands with unspecified remote file names, the remote filename is
709the local filename, which may be altered by a
710.B ntrans
711or
712.B nmap
713setting.
714The resulting filename may then be altered by the remote server if
715.B sunique
716is on.
717.SH "FILE TRANSFER PARAMETERS"
718The FTP specification specifies many parameters which may
719affect a file transfer. The
720.I type
721may be one of \*(lqascii\*(rq, \*(lqimage\*(rq (binary),
722\*(lqebcdic\*(rq, and \*(lqlocal byte size\*(rq (for PDP-10's
723and PDP-20's mostly).
724.I Ftp
725supports the ascii and image types of file transfer,
726plus local byte size 8 for \fBtenex\fP mode transfers.
727.PP
728.I Ftp
729supports only the default values for the remaining
730file transfer parameters:
731.IR mode ,
732.IR form ,
733and
734.IR struct .
735.SH OPTIONS
736Options may be specified at the command line, or to the
737command interpreter.
738.PP
739The
740.B \-v
741(verbose on) option forces
742.I ftp
743to show all responses from the remote server, as well
744as report on data transfer statistics.
745.PP
746The
747.B \-n
748option restrains
749.I ftp
750from attempting \*(lqauto-login\*(rq upon initial connection.
751If auto-login is enabled,
752.I ftp
753will check the
754.I .netrc
755(see below) file in the user's home directory for an entry describing
756an account on the remote machine. If no entry exists,
757.I ftp
758will prompt for the remote machine login name (default is the user
759identity on the local machine), and, if necessary, prompt for a password
760and an account with which to login.
761.PP
762The
763.B \-i
764option turns off interactive prompting during
765multiple file transfers.
766.PP
767The
768.B \-d
769option enables debugging.
770.PP
771The
772.B \-g
773option disables file name globbing.
774.SH "THE .netrc FILE"
775The .netrc file contains login and initialization information
776used by the auto-login process.
777It resides in the user's home directory.
778The following tokens are recognized; they may be separated by spaces,
779tabs, or new-lines:
780.TP
781\fBmachine\fP \fIname\fP
782Identify a remote machine name.
783The auto-login process searches the .netrc file for a
784.B machine
785token that matches the remote machine specified on the
786.I ftp
787command line or as an
788.B open
789command argument.
790Once a match is made, the subsequent .netrc tokens are processed,
791stopping when the end of file is reached or another
792.B machine
793token is encountered.
794.TP
795\fBlogin\fP \fIname\fP
796Identify a user on the remote machine.
797If this token is present, the auto-login process will initiate
798a login using the specified name.
799.TP
800\fBpassword\fP \fIstring\fP
801Supply a password.
802If this token is present, the auto-login process will supply the
803specified string if the remote server requires a password as part
804of the login process.
805Note that if this token is present in the .netrc file,
806.I ftp
807will abort the auto-login process if the .netrc is readable by
808anyone besides the user.
809.TP
810\fBaccount\fP \fIstring\fP
811Supply an additional account password.
812If this token is present, the auto-login process will supply the
813specified string if the remote server requires an additional
814account password, or the auto-login process will initiate an
815ACCT command if it does not.
816.TP
817\fBmacdef\fP \fIname\fP
818Define a macro.
819This token functions like the
820.I ftp
821.B macdef
822command functions.
823A macro is defined with the specified name; its contents begin with the
824next .netrc line and continue until a null line (consecutive new-line
825characters) is encountered.
826If a macro named
827.I init
828is defined, it is automatically executed as the last step in the
829auto-login process.
830.SH "SEE ALSO"
831ftpd(8)
832.SH BUGS
833Correct execution of many commands depends upon proper behavior
834by the remote server.
835.PP
836An error in the treatment of carriage returns
837in the 4.2BSD UNIX ascii-mode transfer code
838has been corrected.
839This correction may result in incorrect transfers of binary files
840to and from 4.2BSD servers using the ascii type.
841Avoid this problem by using the binary image type.