Wed Jul 15 19:23:44 2020 UTC ()
Try to improve markup for better PostScript output.


(uwe)
diff -r1.140 -r1.141 src/usr.bin/ftp/ftp.1

cvs diff -r1.140 -r1.141 src/usr.bin/ftp/ftp.1 (expand / switch to unified diff)

--- src/usr.bin/ftp/ftp.1 2020/07/15 17:36:38 1.140
+++ src/usr.bin/ftp/ftp.1 2020/07/15 19:23:44 1.141
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: ftp.1,v 1.140 2020/07/15 17:36:38 uwe Exp $ 1.\" $NetBSD: ftp.1,v 1.141 2020/07/15 19:23:44 uwe Exp $
2.\" 2.\"
3.\" Copyright (c) 1996-2020 The NetBSD Foundation, Inc. 3.\" Copyright (c) 1996-2020 The NetBSD Foundation, Inc.
4.\" All rights reserved. 4.\" All rights reserved.
5.\" 5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation 6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Luke Mewburn. 7.\" by Luke Mewburn.
8.\" 8.\"
9.\" Redistribution and use in source and binary forms, with or without 9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions 10.\" modification, are permitted provided that the following conditions
11.\" are met: 11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright 12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer. 13.\" notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright 14.\" 2. Redistributions in binary form must reproduce the above copyright
@@ -465,38 +465,36 @@ output. @@ -465,38 +465,36 @@ output.
465If no local file is specified, or if 465If no local file is specified, or if
466.Ar local-file 466.Ar local-file
467is 467is
468.Sq Fl , 468.Sq Fl ,
469the output is sent to the terminal. 469the output is sent to the terminal.
470.It Ic disconnect 470.It Ic disconnect
471A synonym for 471A synonym for
472.Ic close . 472.Ic close .
473.It Ic edit 473.It Ic edit
474Toggle command line editing, and context sensitive command and file 474Toggle command line editing, and context sensitive command and file
475completion. 475completion.
476This is automatically enabled if input is from a terminal, and 476This is automatically enabled if input is from a terminal, and
477disabled otherwise. 477disabled otherwise.
478.It Ic epsv epsv4 epsv6 478.It Ic epsv , epsv4 , epsv6
479Toggle the use of the extended 479Toggle the use of the extended
480.Dv EPSV 480.Dv EPSV
481and 481and
482.Dv EPRT 482.Dv EPRT
483commands on all IP, IPv4, and IPv6 connections respectively. 483commands on all IP, IPv4, and IPv6 connections respectively.
484First try 484First try
485.Dv EPSV / 485.Dv EPSV Ns \^/\^ Ns Dv EPRT ,
486.Dv EPRT , 
487and then 486and then
488.Dv PASV / 487.Dv PASV Ns \^/\^ Ns Dv PORT .
489.Dv PORT . 
490This is enabled by default. 488This is enabled by default.
491If an extended command fails then this option will be temporarily 489If an extended command fails then this option will be temporarily
492disabled for the duration of the current connection, or until 490disabled for the duration of the current connection, or until
493.Ic epsv , 491.Ic epsv ,
494.Ic epsv4 , 492.Ic epsv4 ,
495or 493or
496.Ic epsv6 494.Ic epsv6
497is executed again. 495is executed again.
498.It Ic exit 496.It Ic exit
499A synonym for 497A synonym for
500.Ic bye . 498.Ic bye .
501.It Ic features 499.It Ic features
502Display what features the remote server supports (using the 500Display what features the remote server supports (using the
@@ -579,27 +577,27 @@ Globbing for @@ -579,27 +577,27 @@ Globbing for
579is done as in 577is done as in
580.Xr csh 1 . 578.Xr csh 1 .
581For 579For
582.Ic mdelete , 580.Ic mdelete ,
583.Ic mget , 581.Ic mget ,
584and 582and
585.Ic mreget , 583.Ic mreget ,
586each remote file name is expanded 584each remote file name is expanded
587separately on the remote machine and the lists are not merged. 585separately on the remote machine and the lists are not merged.
588Expansion of a directory name is likely to be 586Expansion of a directory name is likely to be
589different from expansion of the name of an ordinary file: 587different from expansion of the name of an ordinary file:
590the exact result depends on the foreign operating system and ftp server, 588the exact result depends on the foreign operating system and ftp server,
591and can be previewed by doing 589and can be previewed by doing
592.Ql mls remote-files \- 590.Sq Li mls remote-files \- .
593Note: 591Note:
594.Ic mget , 592.Ic mget ,
595.Ic mput 593.Ic mput
596and 594and
597.Ic mreget 595.Ic mreget
598are not meant to transfer 596are not meant to transfer
599entire directory subtrees of files. 597entire directory subtrees of files.
600That can be done by 598That can be done by
601transferring a 599transferring a
602.Xr tar 1 600.Xr tar 1
603archive of the subtree (in binary mode). 601archive of the subtree (in binary mode).
604.It Ic hash Op Ar size 602.It Ic hash Op Ar size
605Toggle hash-sign 603Toggle hash-sign
@@ -660,52 +658,52 @@ defined macros. @@ -660,52 +658,52 @@ defined macros.
660Macro names can be a maximum of 8 characters. 658Macro names can be a maximum of 8 characters.
661Macros are only applicable to the current session they are 659Macros are only applicable to the current session they are
662defined within (or if defined outside a session, to the session 660defined within (or if defined outside a session, to the session
663invoked with the next 661invoked with the next
664.Ic open 662.Ic open
665command), and remain defined until a 663command), and remain defined until a
666.Ic close 664.Ic close
667command is executed. 665command is executed.
668To invoke a macro, use the 666To invoke a macro, use the
669.Ic $ 667.Ic $
670command (see above). 668command (see above).
671.Pp 669.Pp
672The macro processor interprets 670The macro processor interprets
673.Sq $ 671.Ql $
674and 672and
675.Sq \e 673.Ql \e
676as special characters. 674as special characters.
677A 675A
678.Sq $ 676.Ql $
679followed by a number (or numbers) is replaced by the 677followed by a number (or numbers) is replaced by the
680corresponding argument on the macro invocation command line. 678corresponding argument on the macro invocation command line.
681A 679A
682.Sq $ 680.Ql $
683followed by an 681followed by an
684.Sq i 682.Ql i
685signals the macro processor that the executing macro is to be 683signals the macro processor that the executing macro is to be
686looped. 684looped.
687On the first pass 685On the first pass
688.Dq $i 686.Ql $i
689is replaced by the first argument on the macro invocation command 687is replaced by the first argument on the macro invocation command
690line, on the second pass it is replaced by the second argument, 688line, on the second pass it is replaced by the second argument,
691and so on. 689and so on.
692A 690A
693.Sq \e 691.Ql \e
694followed by any character is replaced by that character. 692followed by any character is replaced by that character.
695Use the 693Use the
696.Sq \e 694.Ql \e
697to prevent special treatment of the 695to prevent special treatment of the
698.Sq $ . 696.Ql $ .
699.It Ic mdelete Op Ar remote-files 697.It Ic mdelete Op Ar remote-files
700Delete the 698Delete the
701.Ar remote-files 699.Ar remote-files
702on the remote machine. 700on the remote machine.
703.It Ic mdir Ar remote-files local-file 701.It Ic mdir Ar remote-files local-file
704Like 702Like
705.Ic dir , 703.Ic dir ,
706except multiple remote files may be specified. 704except multiple remote files may be specified.
707If interactive prompting is on, 705If interactive prompting is on,
708.Nm 706.Nm
709will prompt the user to verify that the last argument is indeed the 707will prompt the user to verify that the last argument is indeed the
710target local file for receiving 708target local file for receiving
711.Ic mdir 709.Ic mdir
@@ -720,58 +718,58 @@ for each file name thus produced. @@ -720,58 +718,58 @@ for each file name thus produced.
720See 718See
721.Ic glob 719.Ic glob
722for details on the filename expansion. 720for details on the filename expansion.
723Resulting file names will then be processed according to 721Resulting file names will then be processed according to
724.Ic case , 722.Ic case ,
725.Ic ntrans , 723.Ic ntrans ,
726and 724and
727.Ic nmap 725.Ic nmap
728settings. 726settings.
729Files are transferred into the local working directory, 727Files are transferred into the local working directory,
730which can be changed with 728which can be changed with
731.Ql lcd directory ; 729.Ql lcd directory ;
732new local directories can be created with 730new local directories can be created with
733.Ql "\&! mkdir directory" . 731.Sq Li "\&! mkdir directory" .
734.It Ic mkdir Ar directory-name 732.It Ic mkdir Ar directory-name
735Make a directory on the remote machine. 733Make a directory on the remote machine.
736.It Ic mls Ar remote-files local-file 734.It Ic mls Ar remote-files local-file
737Like 735Like
738.Ic ls , 736.Ic ls ,
739except multiple remote files may be specified, 737except multiple remote files may be specified,
740and the 738and the
741.Ar local-file 739.Ar local-file
742must be specified. 740must be specified.
743If interactive prompting is on, 741If interactive prompting is on,
744.Nm 742.Nm
745will prompt the user to verify that the last argument is indeed the 743will prompt the user to verify that the last argument is indeed the
746target local file for receiving 744target local file for receiving
747.Ic mls 745.Ic mls
748output. 746output.
749.It Ic mlsd Op Ar remote-path 747.It Ic mlsd Op Ar remote-path
750Display the contents of 748Display the contents of
751.Ar remote-path 749.Ar remote-path
752(which should default to the current directory if not given) 750(which should default to the current directory if not given)
753in a machine-parsable form, using 751in a machine-parsable form, using
754.Dv MLSD . 752.Dv MLSD .
755The format of display can be changed with 753The format of display can be changed with
756.Sq "remopts mlst ..." . 754.Sq Li "remopts mlst ..." .
757.It Ic mlst Op Ar remote-path 755.It Ic mlst Op Ar remote-path
758Display the details about 756Display the details about
759.Ar remote-path 757.Ar remote-path
760(which should default to the current directory if not given) 758(which should default to the current directory if not given)
761in a machine-parsable form, using 759in a machine-parsable form, using
762.Dv MLST . 760.Dv MLST .
763The format of display can be changed with 761The format of display can be changed with
764.Sq "remopts mlst ..." . 762.Sq Li "remopts mlst ..." .
765.It Ic mode Ar mode-name 763.It Ic mode Ar mode-name
766Set the file transfer 764Set the file transfer
767.Ic mode 765.Ic mode
768to 766to
769.Ar mode-name . 767.Ar mode-name .
770The default (and only supported) 768The default (and only supported)
771mode is 769mode is
772.Dq stream . 770.Dq stream .
773.It Ic modtime Ar remote-file 771.It Ic modtime Ar remote-file
774Show the last modification time of the file on the remote machine, in 772Show the last modification time of the file on the remote machine, in
775.Li RFC 2822 773.Li RFC 2822
776format. 774format.
777.It Ic more Ar file 775.It Ic more Ar file
@@ -797,124 +795,144 @@ but performs a @@ -797,124 +795,144 @@ but performs a
797.Ic reget 795.Ic reget
798instead of 796instead of
799.Ic get . 797.Ic get .
800.It Ic msend Ar local-files 798.It Ic msend Ar local-files
801A synonym for 799A synonym for
802.Ic mput . 800.Ic mput .
803.It Ic newer Ar remote-file Op Ar local-file 801.It Ic newer Ar remote-file Op Ar local-file
804Get the file only if the modification time of the remote file is more 802Get the file only if the modification time of the remote file is more
805recent that the file on the current system. 803recent that the file on the current system.
806If the file does not 804If the file does not
807exist on the current system, the remote file is considered 805exist on the current system, the remote file is considered
808.Ic newer . 806.Ic newer .
809Otherwise, this command is identical to 807Otherwise, this command is identical to
810.Ar get . 808.Ic get .
811.It Ic nlist Op Ar remote-path Op Ar local-file 809.It Ic nlist Op Ar remote-path Op Ar local-file
812A synonym for 810A synonym for
813.Ic ls . 811.Ic ls .
814.It Ic nmap Op Ar inpattern outpattern 812.It Ic nmap Op Ar inpattern outpattern
815Set or unset the filename mapping mechanism. 813Set or unset the filename mapping mechanism.
816If no arguments are specified, the filename mapping mechanism is unset. 814If no arguments are specified, the filename mapping mechanism is unset.
817If arguments are specified, remote filenames are mapped during 815If arguments are specified, remote filenames are mapped during
818.Ic mput 816.Ic mput
819commands and 817commands and
820.Ic put 818.Ic put
821commands issued without a specified remote target filename. 819commands issued without a specified remote target filename.
822If arguments are specified, local filenames are mapped during 820If arguments are specified, local filenames are mapped during
823.Ic mget 821.Ic mget
824commands and 822commands and
825.Ic get 823.Ic get
826commands issued without a specified local target filename. 824commands issued without a specified local target filename.
827This command is useful when connecting to a 825This command is useful when connecting to a
828.No non\- Ns Ux 826.No non\- Ns Ux
829remote computer 827remote computer
830with different file naming conventions or practices. 828with different file naming conventions or practices.
831The mapping follows the pattern set by 829The mapping follows the pattern set by
832.Ar inpattern 830.Ar inpattern
833and 831and
834.Ar outpattern . 832.Ar outpattern .
835.Op Ar Inpattern 833.Pp
 834.Ar inpattern
836is a template for incoming filenames (which may have already been 835is a template for incoming filenames (which may have already been
837processed according to the 836processed according to the
838.Ic ntrans 837.Ic ntrans
839and 838and
840.Ic case 839.Ic case
841settings). 840settings).
842Variable templating is accomplished by including the 841Variable templating is accomplished by including the
843sequences 842sequences
844.Dq $1 , 843.Ql $1 ,
845.Dq $2 , 844.Ql $2 ,
846\&... 845\&...\|,
847.Dq $9 846.Ql $9
848in 847in
849.Ar inpattern . 848.Ar inpattern .
850Use 849Use
851.Sq \e 850.Ql \e
852to prevent this special treatment of the 851to prevent this special treatment of the
853.Sq $ 852.Ql $
854character. 853character.
855All other characters are treated literally, and are used to determine the 854All other characters are treated literally, and are used to determine the
856.Ic nmap 855.Ic nmap
857.Op Ar inpattern 856.Op Ar inpattern
858variable values. 857variable values.
859For example, given 858For example, given
860.Ar inpattern 859.Ar inpattern
861$1.$2 and the remote file name "mydata.data", $1 would have the value 860.Sq Li $1.$2
862"mydata", and $2 would have the value "data". 861and the remote file name
 862.Sq Li mydata.data ,
 863.Ql $1
 864would have the value
 865.Sq Li mydata ,
 866and
 867.Ql $2
 868would have the value
 869.Sq Li data .
 870.Pp
863The 871The
864.Ar outpattern 872.Ar outpattern
865determines the resulting mapped filename. 873determines the resulting mapped filename.
866The sequences 874The sequences
867.Dq $1 , 875.Ql $1 ,
868.Dq $2 , 876.Ql $2 ,
869\&... 877\&...\|,
870.Dq $9 878.Ql $9
871are replaced by any value resulting from the 879are replaced by any value resulting from the
872.Ar inpattern 880.Ar inpattern
873template. 881template.
874The sequence 882The sequence
875.Dq $0 883.Ql $0
876is replaced by the original filename. 884is replaced by the original filename.
877Additionally, the sequence 885Additionally, the sequence
878.Dq Op Ar seq1 , Ar seq2 886.Dq Op Ar seq1 , Ar seq2
879is replaced by 887is replaced by
880.Op Ar seq1 888.Ar seq1
881if 889if
882.Ar seq1 890.Ar seq1
883is not a null string; otherwise it is replaced by 891is not a null string; otherwise it is replaced by
884.Ar seq2 . 892.Ar seq2 .
885For example, the command 893For example, the command
886.Pp 894.Pp
887.Bd -literal -offset indent -compact 895.Dl nmap $1.$2.$3 [$1,$2].[$2,file]
888nmap $1.$2.$3 [$1,$2].[$2,file] 
889.Ed 
890.Pp 896.Pp
891would yield 897would yield
892the output filename "myfile.data" for input filenames "myfile.data" and 898the output filename
893"myfile.data.old", "myfile.file" for the input filename "myfile", and 899.Sq Li myfile.data
894"myfile.myfile" for the input filename ".myfile". 900for input filenames
 901.Sq Li myfile.data
 902and
 903.Sq Li myfile.data.old ,
 904.Sq Li myfile.file
 905for the input filename
 906.Sq Li myfile ,
 907and
 908.Sq Li myfile.myfile
 909for the input filename
 910.Sq Li "\&.myfile" .
895Spaces may be included in 911Spaces may be included in
896.Ar outpattern , 912.Ar outpattern ,
897as in the example: 913as in the example:
 914.Pp
898.Dl nmap $1 sed "s/ *$//" > $1 915.Dl nmap $1 sed "s/ *$//" > $1
 916.Pp
899Use the 917Use the
900.Sq \e 918.Ql \e
901character to prevent special treatment 919character to prevent special treatment
902of the 920of the
903.Sq $ , 921.Ql $ ,
904.Sq \&[ , 922.Ql \&[ ,
905.Sq \&] , 923.Ql \&] ,
906and 924and
907.Sq \&, 925.Ql \&,
908characters. 926characters.
909.It Ic ntrans Op Ar inchars Op Ar outchars 927.It Ic ntrans Op Ar inchars Op Ar outchars
910Set or unset the filename character translation mechanism. 928Set or unset the filename character translation mechanism.
911If no arguments are specified, the filename character 929If no arguments are specified, the filename character
912translation mechanism is unset. 930translation mechanism is unset.
913If arguments are specified, characters in 931If arguments are specified, characters in
914remote filenames are translated during 932remote filenames are translated during
915.Ic mput 933.Ic mput
916commands and 934commands and
917.Ic put 935.Ic put
918commands issued without a specified remote target filename. 936commands issued without a specified remote target filename.
919If arguments are specified, characters in 937If arguments are specified, characters in
920local filenames are translated during 938local filenames are translated during
@@ -1015,27 +1033,27 @@ Perform @@ -1015,27 +1033,27 @@ Perform
1015.Op Ar remote-path , 1033.Op Ar remote-path ,
1016and display the result with the program specified by the 1034and display the result with the program specified by the
1017.Ic "set pager" 1035.Ic "set pager"
1018option. 1036option.
1019.It Ic preserve 1037.It Ic preserve
1020Toggle preservation of modification times on retrieved files. 1038Toggle preservation of modification times on retrieved files.
1021.It Ic progress 1039.It Ic progress
1022Toggle display of transfer progress bar. 1040Toggle display of transfer progress bar.
1023The progress bar will be disabled for a transfer that has 1041The progress bar will be disabled for a transfer that has
1024.Ar local-file 1042.Ar local-file
1025as 1043as
1026.Sq Fl 1044.Sq Fl
1027or a command that starts with 1045or a command that starts with
1028.Sq \&| . 1046.Ql \&| .
1029Refer to 1047Refer to
1030.Sx FILE NAMING CONVENTIONS 1048.Sx FILE NAMING CONVENTIONS
1031for more information. 1049for more information.
1032Enabling 1050Enabling
1033.Ic progress 1051.Ic progress
1034disables 1052disables
1035.Ic hash . 1053.Ic hash .
1036.It Ic prompt 1054.It Ic prompt
1037Toggle interactive prompting. 1055Toggle interactive prompting.
1038Interactive prompting 1056Interactive prompting
1039occurs during multiple file transfers to allow the 1057occurs during multiple file transfers to allow the
1040user to selectively retrieve or store files. 1058user to selectively retrieve or store files.
1041If prompting is turned off (default is on), any 1059If prompting is turned off (default is on), any
@@ -1078,31 +1096,33 @@ Display a help message. @@ -1078,31 +1096,33 @@ Display a help message.
1078Any other response will answer 1096Any other response will answer
1079.Sq yes 1097.Sq yes
1080to the current file. 1098to the current file.
1081.It Ic proxy Ar ftp-command 1099.It Ic proxy Ar ftp-command
1082Execute an ftp command on a secondary control connection. 1100Execute an ftp command on a secondary control connection.
1083This command allows simultaneous connection to two remote 1101This command allows simultaneous connection to two remote
1084.Tn FTP 1102.Tn FTP
1085servers for transferring files between the two servers. 1103servers for transferring files between the two servers.
1086The first 1104The first
1087.Ic proxy 1105.Ic proxy
1088command should be an 1106command should be an
1089.Ic open , 1107.Ic open ,
1090to establish the secondary control connection. 1108to establish the secondary control connection.
1091Enter the command "proxy ?" to see other 1109Enter the command
 1110.Sq Li "proxy ?"
 1111to see other
1092.Tn FTP 1112.Tn FTP
1093commands executable on the secondary connection. 1113commands executable on the secondary connection.
1094The following commands behave differently when prefaced by 1114The following commands behave differently when prefaced by
1095.Ic proxy : 1115.Ic proxy\^ :
1096.Ic open 1116.Ic open
1097will not define new macros during the auto-login process, 1117will not define new macros during the auto-login process,
1098.Ic close 1118.Ic close
1099will not erase existing macro definitions, 1119will not erase existing macro definitions,
1100.Ic get 1120.Ic get
1101and 1121and
1102.Ic mget 1122.Ic mget
1103transfer files from the host on the primary control connection 1123transfer files from the host on the primary control connection
1104to the host on the secondary control connection, and 1124to the host on the secondary control connection, and
1105.Ic put , 1125.Ic put ,
1106.Ic mput , 1126.Ic mput ,
1107and 1127and
1108.Ic append 1128.Ic append
@@ -1127,54 +1147,54 @@ in naming the remote file. @@ -1127,54 +1147,54 @@ in naming the remote file.
1127File transfer uses the 1147File transfer uses the
1128current settings for 1148current settings for
1129.Ic type , 1149.Ic type ,
1130.Ic format , 1150.Ic format ,
1131.Ic mode , 1151.Ic mode ,
1132and 1152and
1133.Ic structure . 1153.Ic structure .
1134.It Ic pwd 1154.It Ic pwd
1135Print the name of the current working directory on the remote 1155Print the name of the current working directory on the remote
1136machine. 1156machine.
1137.It Ic quit 1157.It Ic quit
1138A synonym for 1158A synonym for
1139.Ic bye . 1159.Ic bye .
1140.It Ic quote Ar arg1 arg2 ... 1160.It Ic quote Op Ar arg ...
1141The arguments specified are sent, verbatim, to the remote 1161The arguments specified are sent, verbatim, to the remote
1142.Tn FTP 1162.Tn FTP
1143server. 1163server.
1144.It Ic rate Ar direction Oo Ar maximum Oo Ar increment Oc Oc 1164.It Ic rate Ar direction Oo Ar maximum Oo Ar increment Oc Oc
1145Throttle the maximum transfer rate to 1165Throttle the maximum transfer rate to
1146.Ar maximum 1166.Ar maximum
1147bytes/second. 1167bytes/second.
1148If 1168If
1149.Ar maximum 1169.Ar maximum
1150is 0, disable the throttle. 1170is 0, disable the throttle.
1151.Pp 1171.Pp
1152.Ar direction 1172.Ar direction
1153may be one of: 1173may be one of:
1154.Bl -tag -width "all" -offset indent -compact 1174.Bl -tag -width ".Cm all" -offset indent -compact
1155.It Cm all 1175.It Cm all
1156Both directions. 1176Both directions.
1157.It Cm get 1177.It Cm get
1158Incoming transfers. 1178Incoming transfers.
1159.It Cm put 1179.It Cm put
1160Outgoing transfers. 1180Outgoing transfers.
1161.El 1181.El
1162.Pp 1182.Pp
1163.Ar maximum 1183.Ar maximum
1164can be modified on the fly by 1184can be modified on the fly by
1165.Ar increment 1185.Ar increment
1166bytes (default: 1024) each time a given signal is received: 1186bytes (default: 1024) each time a given signal is received:
1167.Bl -tag -width "SIGUSR1" -offset indent 1187.Bl -tag -width ".Dv SIGUSR1" -offset indent
1168.It Dv SIGUSR1 1188.It Dv SIGUSR1
1169Increment 1189Increment
1170.Ar maximum 1190.Ar maximum
1171by 1191by
1172.Ar increment 1192.Ar increment
1173bytes. 1193bytes.
1174.It Dv SIGUSR2 1194.It Dv SIGUSR2
1175Decrement 1195Decrement
1176.Ar maximum 1196.Ar maximum
1177by 1197by
1178.Ar increment 1198.Ar increment
1179bytes. 1199bytes.
1180The result must be a positive number. 1200The result must be a positive number.
@@ -1212,27 +1232,27 @@ This command @@ -1212,27 +1232,27 @@ This command
1212is useful when transferring very large files over networks that 1232is useful when transferring very large files over networks that
1213are prone to dropping connections. 1233are prone to dropping connections.
1214.It Ic remopts Ar command Op Ar command-options 1234.It Ic remopts Ar command Op Ar command-options
1215Set options on the remote 1235Set options on the remote
1216.Tn FTP 1236.Tn FTP
1217server for 1237server for
1218.Ar command 1238.Ar command
1219to 1239to
1220.Ar command-options 1240.Ar command-options
1221(whose absence is handled on a command-specific basis). 1241(whose absence is handled on a command-specific basis).
1222Remote 1242Remote
1223.Tn FTP 1243.Tn FTP
1224commands known to support options include: 1244commands known to support options include:
1225.Sq MLST 1245.Dv MLST
1226(used for 1246(used for
1227.Dv MLSD 1247.Dv MLSD
1228and 1248and
1229.Dv MLST ) . 1249.Dv MLST ) .
1230.It Ic rename Op Ar from Op Ar to 1250.It Ic rename Op Ar from Op Ar to
1231Rename the file 1251Rename the file
1232.Ar from 1252.Ar from
1233on the remote machine, to the file 1253on the remote machine, to the file
1234.Ar to . 1254.Ar to .
1235.It Ic reset 1255.It Ic reset
1236Clear reply queue. 1256Clear reply queue.
1237This command re-synchronizes command/reply sequencing with the remote 1257This command re-synchronizes command/reply sequencing with the remote
1238.Tn FTP 1258.Tn FTP
@@ -1265,30 +1285,36 @@ Delete a directory on the remote machine @@ -1265,30 +1285,36 @@ Delete a directory on the remote machine
1265With no arguments, show status of remote machine. 1285With no arguments, show status of remote machine.
1266If 1286If
1267.Ar remote-file 1287.Ar remote-file
1268is specified, show status of 1288is specified, show status of
1269.Ar remote-file 1289.Ar remote-file
1270on remote machine. 1290on remote machine.
1271.It Ic runique 1291.It Ic runique
1272Toggle storing of files on the local system with unique filenames. 1292Toggle storing of files on the local system with unique filenames.
1273If a file already exists with a name equal to the target 1293If a file already exists with a name equal to the target
1274local filename for a 1294local filename for a
1275.Ic get 1295.Ic get
1276or 1296or
1277.Ic mget 1297.Ic mget
1278command, a ".1" is appended to the name. 1298command, a
 1299.Ql \&.1
 1300is appended to the name.
1279If the resulting name matches another existing file, 1301If the resulting name matches another existing file,
1280a ".2" is appended to the original name. 1302a
1281If this process continues up to ".99", an error 1303.Ql \&.2
 1304is appended to the original name.
 1305If this process continues up to
 1306.Ql .99 ,
 1307an error
1282message is printed, and the transfer does not take place. 1308message is printed, and the transfer does not take place.
1283The generated unique filename will be reported. 1309The generated unique filename will be reported.
1284Note that 1310Note that
1285.Ic runique 1311.Ic runique
1286will not affect local files generated from a shell command 1312will not affect local files generated from a shell command
1287(see below). 1313(see below).
1288The default value is off. 1314The default value is off.
1289.It Ic send Ar local-file Op Ar remote-file 1315.It Ic send Ar local-file Op Ar remote-file
1290A synonym for 1316A synonym for
1291.Ic put . 1317.Ic put .
1292.It Ic sendport 1318.It Ic sendport
1293Toggle the use of 1319Toggle the use of
1294.Dv PORT 1320.Dv PORT
@@ -1346,27 +1372,27 @@ Defaults to @@ -1346,27 +1372,27 @@ Defaults to
1346.It Cm no_proxy 1372.It Cm no_proxy
1347Defaults to 1373Defaults to
1348.Ev $no_proxy . 1374.Ev $no_proxy .
1349.It Cm pager 1375.It Cm pager
1350Defaults to 1376Defaults to
1351.Ev $PAGER . 1377.Ev $PAGER .
1352.It Cm prompt 1378.It Cm prompt
1353Defaults to 1379Defaults to
1354.Ev $FTPPROMPT . 1380.Ev $FTPPROMPT .
1355.It Cm rprompt 1381.It Cm rprompt
1356Defaults to 1382Defaults to
1357.Ev $FTPRPROMPT . 1383.Ev $FTPRPROMPT .
1358.El 1384.El
1359.It Ic site Ar arg1 arg2 ... 1385.It Ic site Op Ar arg ...
1360The arguments specified are sent, verbatim, to the remote 1386The arguments specified are sent, verbatim, to the remote
1361.Tn FTP 1387.Tn FTP
1362server as a 1388server as a
1363.Dv SITE 1389.Dv SITE
1364command. 1390command.
1365.It Ic size Ar remote-file 1391.It Ic size Ar remote-file
1366Return size of 1392Return size of
1367.Ar remote-file 1393.Ar remote-file
1368on remote machine. 1394on remote machine.
1369.It Ic sndbuf Ar size 1395.It Ic sndbuf Ar size
1370Set the size of the socket send buffer to 1396Set the size of the socket send buffer to
1371.Ar size . 1397.Ar size .
1372.It Ic status 1398.It Ic status
@@ -1467,27 +1493,27 @@ if verbose is on, when a file transfer c @@ -1467,27 +1493,27 @@ if verbose is on, when a file transfer c
1467regarding the efficiency of the transfer are reported. 1493regarding the efficiency of the transfer are reported.
1468By default, 1494By default,
1469verbose is on. 1495verbose is on.
1470.It Ic xferbuf Ar size 1496.It Ic xferbuf Ar size
1471Set the size of the socket send and receive buffers to 1497Set the size of the socket send and receive buffers to
1472.Ar size . 1498.Ar size .
1473.It Ic \&? Op Ar command 1499.It Ic \&? Op Ar command
1474A synonym for 1500A synonym for
1475.Ic help . 1501.Ic help .
1476.El 1502.El
1477.Pp 1503.Pp
1478Command arguments which have embedded spaces may be quoted with 1504Command arguments which have embedded spaces may be quoted with
1479quote 1505quote
1480.Sq \&" 1506.Ql \&\(dq
1481marks. 1507marks.
1482.Pp 1508.Pp
1483Commands which toggle settings can take an explicit 1509Commands which toggle settings can take an explicit
1484.Ic on 1510.Ic on
1485or 1511or
1486.Ic off 1512.Ic off
1487argument to force the setting appropriately. 1513argument to force the setting appropriately.
1488.Pp 1514.Pp
1489Commands which take a byte count as an argument 1515Commands which take a byte count as an argument
1490(e.g., 1516(e.g.,
1491.Ic hash , 1517.Ic hash ,
1492.Ic rate , 1518.Ic rate ,
1493and 1519and
@@ -1502,27 +1528,27 @@ Causes no modification. @@ -1502,27 +1528,27 @@ Causes no modification.
1502.It Li k 1528.It Li k
1503Kilo; multiply the argument by 1024 1529Kilo; multiply the argument by 1024
1504.It Li m 1530.It Li m
1505Mega; multiply the argument by 1048576 1531Mega; multiply the argument by 1048576
1506.It Li g 1532.It Li g
1507Giga; multiply the argument by 1073741824 1533Giga; multiply the argument by 1073741824
1508.El 1534.El
1509.Pp 1535.Pp
1510If 1536If
1511.Nm 1537.Nm
1512receives a 1538receives a
1513.Dv SIGINFO 1539.Dv SIGINFO
1514(see the 1540(see the
1515.Dq status 1541.Cm status
1516argument of 1542argument of
1517.Xr stty 1 ) 1543.Xr stty 1 )
1518or 1544or
1519.Dv SIGQUIT 1545.Dv SIGQUIT
1520signal whilst a transfer is in progress, the current transfer rate 1546signal whilst a transfer is in progress, the current transfer rate
1521statistics will be written to the standard error output, in the 1547statistics will be written to the standard error output, in the
1522same format as the standard completion message. 1548same format as the standard completion message.
1523.Sh AUTO-FETCHING FILES 1549.Sh AUTO-FETCHING FILES
1524In addition to standard commands, this version of 1550In addition to standard commands, this version of
1525.Nm 1551.Nm
1526supports an auto-fetch feature. 1552supports an auto-fetch feature.
1527To enable auto-fetch, simply pass the list of hostnames/files 1553To enable auto-fetch, simply pass the list of hostnames/files
1528on the command line. 1554on the command line.
@@ -1532,27 +1558,27 @@ The following formats are valid syntax f @@ -1532,27 +1558,27 @@ The following formats are valid syntax f
1532.\" [user@]host:[path][/] 1558.\" [user@]host:[path][/]
1533.It Oo Ar user Ns Li \&@ Oc Ns Ar host Ns Li \&: Ns Oo Ar path Oc \ 1559.It Oo Ar user Ns Li \&@ Oc Ns Ar host Ns Li \&: Ns Oo Ar path Oc \
1534Ns Oo Li / Oc 1560Ns Oo Li / Oc
1535.Dq Classic 1561.Dq Classic
1536.Tn FTP 1562.Tn FTP
1537format. 1563format.
1538.Pp 1564.Pp
1539If 1565If
1540.Ar path 1566.Ar path
1541contains a glob character and globbing is enabled, 1567contains a glob character and globbing is enabled,
1542(see 1568(see
1543.Ic glob ) , 1569.Ic glob ) ,
1544then the equivalent of 1570then the equivalent of
1545.Ql mget path 1571.Sq Li mget path
1546is performed. 1572is performed.
1547.Pp 1573.Pp
1548If the directory component of 1574If the directory component of
1549.Ar path 1575.Ar path
1550contains no globbing characters, 1576contains no globbing characters,
1551it is stored locally with the name basename (see 1577it is stored locally with the name basename (see
1552.Xr basename 1 ) 1578.Xr basename 1 )
1553of 1579of
1554.Ic path , 1580.Ic path ,
1555in the current directory. 1581in the current directory.
1556Otherwise, the full remote name is used as the local name, 1582Otherwise, the full remote name is used as the local name,
1557relative to the local root directory. 1583relative to the local root directory.
1558.\" ftp://[user[:password]@]host[:port]/path[/][;type=X] 1584.\" ftp://[user[:password]@]host[:port]/path[/][;type=X]
@@ -1571,40 +1597,40 @@ Otherwise, transfer the URL using @@ -1571,40 +1597,40 @@ Otherwise, transfer the URL using
1571via the proxy defined in 1597via the proxy defined in
1572.Ic "set ftp_proxy" . 1598.Ic "set ftp_proxy" .
1573If 1599If
1574.Ic "set ftp_proxy" 1600.Ic "set ftp_proxy"
1575isn't defined and 1601isn't defined and
1576.Ar user 1602.Ar user
1577is given, login as 1603is given, login as
1578.Ar user . 1604.Ar user .
1579In this case, use 1605In this case, use
1580.Ar password 1606.Ar password
1581if supplied, otherwise prompt the user for one. 1607if supplied, otherwise prompt the user for one.
1582.Pp 1608.Pp
1583If a suffix of 1609If a suffix of
1584.Sq ;type=A 1610.Sq Li \&;type=A
1585or 1611or
1586.Sq ;type=I 1612.Sq Li \&;type=I
1587is supplied, then the transfer type will take place as 1613is supplied, then the transfer type will take place as
1588ascii or binary (respectively). 1614ascii or binary (respectively).
1589The default transfer type is binary. 1615The default transfer type is binary.
1590.Pp 1616.Pp
1591In order to be compliant with 1617In order to be compliant with
1592.Li RFC 3986 , 1618.Li RFC 3986 ,
1593.Nm 1619.Nm
1594interprets the 1620interprets the
1595.Ar path 1621.Ar path
1596part of an 1622part of an
1597.Dq ftp:// 1623.Sq Li ftp://
1598auto-fetch URL as follows: 1624auto-fetch URL as follows:
1599.Bl -bullet 1625.Bl -bullet
1600.It 1626.It
1601The 1627The
1602.Sq Li / 1628.Sq Li /
1603immediately after the 1629immediately after the
1604.Ar host Ns Oo Li \&: Ns Ar port Oc 1630.Ar host Ns Oo Li \&: Ns Ar port Oc
1605is interpreted as a separator before the 1631is interpreted as a separator before the
1606.Ar path , 1632.Ar path ,
1607and not as part of the 1633and not as part of the
1608.Ar path 1634.Ar path
1609itself. 1635itself.
1610.It 1636.It
@@ -1664,52 +1690,52 @@ and @@ -1664,52 +1690,52 @@ and
1664.Sq Li ~ ) . 1690.Sq Li ~ ) .
1665.El 1691.El
1666.Pp 1692.Pp
1667The above interpretation has the following consequences: 1693The above interpretation has the following consequences:
1668.Bl -bullet 1694.Bl -bullet
1669.It 1695.It
1670The path is interpreted relative to the 1696The path is interpreted relative to the
1671default login directory of the specified user or of the 1697default login directory of the specified user or of the
1672.Sq anonymous 1698.Sq anonymous
1673user. 1699user.
1674If the 1700If the
1675.Pa / 1701.Pa /
1676directory is required, use a leading path of 1702directory is required, use a leading path of
1677.Dq %2F . 1703.Sq Li \&%2F .
1678If a user's home directory is required (and the remote server supports 1704If a user's home directory is required (and the remote server supports
1679the syntax), use a leading path of 1705the syntax), use a leading path of
1680.Dq %7Euser/ . 1706.Sq Li \&%7E Ns Ar user Ns Li / .
1681For example, to retrieve 1707For example, to retrieve
1682.Pa /etc/motd 1708.Pa /etc/motd
1683from 1709from
1684.Sq localhost 1710.Sq Li localhost
1685as the user 1711as the user
1686.Sq myname 1712.Sq Li myname
1687with the password 1713with the password
1688.Sq mypass , 1714.Sq Li mypass ,
1689use 1715use
1690.Dq ftp://myname:mypass@localhost/%2fetc/motd 1716.Sq Li ftp://myname:mypass@localhost/%2fetc/motd
1691.It 1717.It
1692The exact 1718The exact
1693.Ic cd 1719.Ic cd
1694and 1720and
1695.Ic get 1721.Ic get
1696commands can be controlled by careful choice of 1722commands can be controlled by careful choice of
1697where to use 1723where to use
1698.Sq / 1724.Sq Li /
1699and where to use 1725and where to use
1700.Sq %2F 1726.Sq Li \&%2F
1701(or 1727(or
1702.Sq %2f ) . 1728.Sq Li %2f ) .
1703For example, the following URLs correspond to the 1729For example, the following URLs correspond to the
1704equivalents of the indicated commands: 1730equivalents of the indicated commands:
1705.Bl -tag -width "ftp://host/%2Fdir1%2Fdir2%2Ffile" 1731.Bl -tag -width "ftp://host/%2Fdir1%2Fdir2%2Ffile"
1706.It ftp://host/dir1/dir2/file 1732.It ftp://host/dir1/dir2/file
1707.Dq "cd dir1" , 1733.Dq "cd dir1" ,
1708.Dq "cd dir2" , 1734.Dq "cd dir2" ,
1709.Dq "get file" . 1735.Dq "get file" .
1710.It ftp://host/%2Fdir1/dir2/file 1736.It ftp://host/%2Fdir1/dir2/file
1711.Dq "cd /dir1" , 1737.Dq "cd /dir1" ,
1712.Dq "cd dir2" , 1738.Dq "cd dir2" ,
1713.Dq "get file" . 1739.Dq "get file" .
1714.It ftp://host/dir1%2Fdir2/file 1740.It ftp://host/dir1%2Fdir2/file
1715.Dq "cd dir1/dir2" , 1741.Dq "cd dir1/dir2" ,
@@ -1736,51 +1762,51 @@ An @@ -1736,51 +1762,51 @@ An
1736URL, retrieved using the 1762URL, retrieved using the
1737.Tn HTTP 1763.Tn HTTP
1738protocol. 1764protocol.
1739If 1765If
1740.Ic "set http_proxy" 1766.Ic "set http_proxy"
1741is defined, it is used as a URL to an 1767is defined, it is used as a URL to an
1742.Tn HTTP 1768.Tn HTTP
1743proxy server. 1769proxy server.
1744If 1770If
1745.Tn HTTP 1771.Tn HTTP
1746authorization is required to retrieve 1772authorization is required to retrieve
1747.Ar path , 1773.Ar path ,
1748and 1774and
1749.Sq user 1775.Ar user
1750(and optionally 1776(and optionally
1751.Sq password ) 1777.Ar password\^ )
1752is in the URL, use them for the first attempt to authenticate. 1778is in the URL, use them for the first attempt to authenticate.
1753.\" https://[user[:password]@]host[:port]/path 1779.\" https://[user[:password]@]host[:port]/path
1754.It Li https:// Ns Oo Ar user Ns Oo Li \&: Ns Ar password Oc Ns Li \&@ Oc \ 1780.It Li https:// Ns Oo Ar user Ns Oo Li \&: Ns Ar password Oc Ns Li \&@ Oc \
1755Ns Ar host Ns Oo Li \&: Ns Ar port Oc Ns Li / Ns Ar path 1781Ns Ar host Ns Oo Li \&: Ns Ar port Oc Ns Li / Ns Ar path
1756An 1782An
1757.Tn HTTPS 1783.Tn HTTPS
1758URL, retrieved using the 1784URL, retrieved using the
1759.Tn HTTPS 1785.Tn HTTPS
1760protocol. 1786protocol.
1761If 1787If
1762.Ic "set https_proxy" 1788.Ic "set https_proxy"
1763is defined, it is used as a URL to an 1789is defined, it is used as a URL to an
1764.Tn HTTPS 1790.Tn HTTPS
1765proxy server. 1791proxy server.
1766If 1792If
1767.Tn HTTPS 1793.Tn HTTPS
1768authorization is required to retrieve 1794authorization is required to retrieve
1769.Ar path , 1795.Ar path ,
1770and 1796and
1771.Sq user 1797.Ar user
1772(and optionally 1798(and optionally
1773.Sq password ) 1799.Ar password\^ )
1774is in the URL, use them for the first attempt to authenticate. 1800is in the URL, use them for the first attempt to authenticate.
1775There is currently no certificate validation and verification. 1801There is currently no certificate validation and verification.
1776.\" file:///path 1802.\" file:///path
1777.It Li file:/// Ns Ar path 1803.It Li file:/// Ns Ar path
1778A local URL, copied from 1804A local URL, copied from
1779.Pa / Ns Ar path 1805.Pa / Ns Ar path
1780on the local host. 1806on the local host.
1781.\" about: 1807.\" about:
1782.It Li about: Ns Ar topic 1808.It Li about: Ns Ar topic
1783Display information regarding 1809Display information regarding
1784.Ar topic ; 1810.Ar topic ;
1785no file is retrieved for this auto-fetched element. 1811no file is retrieved for this auto-fetched element.
1786Supported values include: 1812Supported values include:
@@ -1803,27 +1829,27 @@ of @@ -1803,27 +1829,27 @@ of
1803.Ar path . 1829.Ar path .
1804Note that if a 1830Note that if a
1805.Tn HTTP 1831.Tn HTTP
1806redirect is received, the fetch is retried using the new target URL 1832redirect is received, the fetch is retried using the new target URL
1807supplied by the server, with a corresponding new 1833supplied by the server, with a corresponding new
1808.Ar path . 1834.Ar path .
1809Using an explicit 1835Using an explicit
1810.Fl o Ar output 1836.Fl o Ar output
1811is recommended, to avoid writing to unexpected file names. 1837is recommended, to avoid writing to unexpected file names.
1812.Pp 1838.Pp
1813If a classic format or an 1839If a classic format or an
1814.Tn FTP 1840.Tn FTP
1815URL format has a trailing 1841URL format has a trailing
1816.Sq / 1842.Ql /
1817or an empty 1843or an empty
1818.Ar path 1844.Ar path
1819component, then 1845component, then
1820.Nm 1846.Nm
1821will connect to the site and 1847will connect to the site and
1822.Ic cd 1848.Ic cd
1823to the directory given as the path, and leave the user in interactive 1849to the directory given as the path, and leave the user in interactive
1824mode ready for further input. 1850mode ready for further input.
1825This will not work if 1851This will not work if
1826.Ic "set ftp_proxy" 1852.Ic "set ftp_proxy"
1827is being used. 1853is being used.
1828.Pp 1854.Pp
1829Direct 1855Direct
@@ -1851,96 +1877,97 @@ instead of @@ -1851,96 +1877,97 @@ instead of
1851For 1877For
1852.Tn HTTP , 1878.Tn HTTP ,
1853this is implemented by using the 1879this is implemented by using the
1854.Sq "Range: bytes=" 1880.Sq "Range: bytes="
1855.Tn "HTTP/1.1" 1881.Tn "HTTP/1.1"
1856directive. 1882directive.
1857.Pp 1883.Pp
1858If WWW or proxy WWW authentication is required, you will be prompted 1884If WWW or proxy WWW authentication is required, you will be prompted
1859to enter a username and password to authenticate with. 1885to enter a username and password to authenticate with.
1860.Pp 1886.Pp
1861When specifying IPv6 numeric addresses in a URL, you need to 1887When specifying IPv6 numeric addresses in a URL, you need to
1862surround the address in square brackets. 1888surround the address in square brackets.
1863E.g.: 1889E.g.:
1864.Dq ftp://[::1]:21/ . 1890.Sq Li ftp://[::1]:21/ .
1865This is because colons are used in IPv6 numeric address as well as 1891This is because colons are used in IPv6 numeric address as well as
1866being the separator for the port number. 1892being the separator for the port number.
1867.Sh ABORTING A FILE TRANSFER 1893.Sh ABORTING A FILE TRANSFER
1868To abort a file transfer, use the terminal interrupt key 1894To abort a file transfer, use the terminal interrupt key
1869(usually Ctrl-C). 1895(usually Ctrl-C).
1870Sending transfers will be immediately halted. 1896Sending transfers will be immediately halted.
1871Receiving transfers will be halted by sending an 1897Receiving transfers will be halted by sending an
1872.Tn FTP 1898.Tn FTP
1873protocol 1899protocol
1874.Dv ABOR 1900.Dv ABOR
1875command to the remote server, and discarding any further data received. 1901command to the remote server, and discarding any further data received.
1876The speed at which this is accomplished depends upon the remote 1902The speed at which this is accomplished depends upon the remote
1877server's support for 1903server's support for
1878.Dv ABOR 1904.Dv ABOR
1879processing. 1905processing.
1880If the remote server does not support the 1906If the remote server does not support the
1881.Dv ABOR 1907.Dv ABOR
1882command, the prompt will not appear until the remote server has completed 1908command, the prompt will not appear until the remote server has completed
1883sending the requested file. 1909sending the requested file.
1884.Pp 1910.Pp
1885If the terminal interrupt key sequence is used whilst 1911If the terminal interrupt key sequence is used whilst
1886.Nm 1912.Nm
1887is awaiting a reply from the remote server for the ABOR processing, 1913is awaiting a reply from the remote server for the
 1914.Dv ABOR
 1915processing,
1888then the connection will be closed. 1916then the connection will be closed.
1889This is different from the traditional behaviour (which ignores the 1917This is different from the traditional behaviour (which ignores the
1890terminal interrupt during this phase), but is considered more useful. 1918terminal interrupt during this phase), but is considered more useful.
1891.Sh FILE NAMING CONVENTIONS 1919.Sh FILE NAMING CONVENTIONS
1892Files specified as arguments to 1920Files specified as arguments to
1893.Nm 1921.Nm
1894commands are processed according to the following rules. 1922commands are processed according to the following rules.
1895.Bl -enum 1923.Bl -enum
1896.It 1924.It
1897If the file name 1925If the file name
1898.Sq Fl 1926.Sq Fl
1899is specified, the 1927is specified, the
1900.Ar stdin 1928.Va stdin
1901(for reading) or 1929(for reading) or
1902.Ar stdout 1930.Va stdout
1903(for writing) is used. 1931(for writing) is used.
1904.It 1932.It
1905If the first character of the file name is 1933If the first character of the file name is
1906.Sq \&| , 1934.Ql \&| ,
1907the 1935the
1908remainder of the argument is interpreted as a shell command. 1936remainder of the argument is interpreted as a shell command.
1909.Nm 1937.Nm
1910then forks a shell, using 1938then forks a shell, using
1911.Xr popen 3 1939.Xr popen 3
1912with the argument supplied, and reads (writes) from the stdout 1940with the argument supplied, and reads (writes) from the stdout
1913(stdin). 1941(stdin).
1914If the shell command includes spaces, the argument 1942If the shell command includes spaces, the argument
1915must be quoted; e.g. 1943must be quoted; e.g.
1916.Dq Qq Li \&| ls\ \-lt . 1944.Sq Li \(dq|\~ls\~\-lt\(dq .
1917A particularly 1945A particularly
1918useful example of this mechanism is: 1946useful example of this mechanism is:
1919.Dq Li dir \&"\&" \&|more . 1947.Sq Li dir\~\(dq\(dq\~|more .
1920.It 1948.It
1921Failing the above checks, if 1949Failing the above checks, if globbing
1922.Dq globbing 
1923is enabled, local file names are expanded according to the rules 1950is enabled, local file names are expanded according to the rules
1924used in the 1951used in the
1925.Xr csh 1 ; 1952.Xr csh 1 ;
1926see the 1953see the
1927.Ic glob 1954.Ic glob
1928command. 1955command.
1929If the 1956If the
1930.Nm 1957.Nm
1931command expects a single local file (e.g. 1958command expects a single local file (e.g.
1932.Ic put ) , 1959.Ic put ) ,
1933only the first filename generated by the "globbing" operation is used. 1960only the first filename generated by the globbing operation is used.
1934.It 1961.It
1935For 1962For
1936.Ic mget 1963.Ic mget
1937commands and 1964commands and
1938.Ic get 1965.Ic get
1939commands with unspecified local file names, the local filename is 1966commands with unspecified local file names, the local filename is
1940the remote filename, which may be altered by a 1967the remote filename, which may be altered by a
1941.Ic case , 1968.Ic case ,
1942.Ic ntrans , 1969.Ic ntrans ,
1943or 1970or
1944.Ic nmap 1971.Ic nmap
1945setting. 1972setting.
1946The resulting filename may then be altered if 1973The resulting filename may then be altered if
@@ -2121,150 +2148,149 @@ followed by a blank line. @@ -2121,150 +2148,149 @@ followed by a blank line.
2121supports interactive command line editing, via the 2148supports interactive command line editing, via the
2122.Xr editline 3 2149.Xr editline 3
2123library. 2150library.
2124It is enabled with the 2151It is enabled with the
2125.Ic edit 2152.Ic edit
2126command, and is enabled by default if input is from a tty. 2153command, and is enabled by default if input is from a tty.
2127Previous lines can be recalled and edited with the arrow keys, 2154Previous lines can be recalled and edited with the arrow keys,
2128and other GNU Emacs-style editing keys may be used as well. 2155and other GNU Emacs-style editing keys may be used as well.
2129.Pp 2156.Pp
2130The 2157The
2131.Xr editline 3 2158.Xr editline 3
2132library is configured with a 2159library is configured with a
2133.Pa .editrc 2160.Pa .editrc
2134file - refer to 2161file \(em refer to
2135.Xr editrc 5 2162.Xr editrc 5
2136for more information. 2163for more information.
2137.Pp 2164.Pp
2138An extra key binding is available to 2165An extra key binding is available to
2139.Nm 2166.Nm
2140to provide context sensitive command and filename completion 2167to provide context sensitive command and filename completion
2141(including remote file completion). 2168(including remote file completion).
2142To use this, bind a key to the 2169To use this, bind a key to the
2143.Xr editline 3 2170.Xr editline 3
2144command 2171command
2145.Ic ftp-complete . 2172.Ic ftp-complete .
2146By default, this is bound to the TAB key. 2173By default, this is bound to the TAB key.
2147.Sh COMMAND LINE PROMPT 2174.Sh COMMAND LINE PROMPT
2148By default, 2175By default,
2149.Nm 2176.Nm
2150displays a command line prompt of 2177displays a command line prompt of
2151.Dq "ftp> " 2178.Sq Li ftp>\~
2152to the user. 2179to the user.
2153This can be changed with the 2180This can be changed with the
2154.Ic "set prompt" 2181.Ic "set prompt"
2155command. 2182command.
2156.Pp 2183.Pp
2157A prompt can be displayed on the right side of the screen (after the 2184A prompt can be displayed on the right side of the screen (after the
2158command input) with the 2185command input) with the
2159.Ic "set rprompt" 2186.Ic "set rprompt"
2160command. 2187command.
2161.Pp 2188.Pp
2162The following formatting sequences are replaced by the given 2189The following formatting sequences are replaced by the given
2163information: 2190information:
2164.Bl -tag -width "%% " -offset indent 2191.Bl -tag -width "%% " -offset indent
2165.It Li \&%/ 2192.It Li \&%/
2166The current remote working directory. 2193The current remote working directory.
2167.\" %c[[0]n], %.[[0]n] 2194.\" %c[[0]n], %.[[0]n]
2168.It \&%c Ns Oo Oo Li 0 Oc Ns Ar n Oc , Ns Li \&%. Ns Oo Oo Li 0 Oc Ns Ar n Oc 2195.It Li \&%c Ns Oo Oo Li 0 Oc Ns Ar n Oc , Li \&%. Ns Oo Oo Li 0 Oc Ns Ar n Oc
2169The trailing component of the current remote working directory, or 2196The trailing component of the current remote working directory, or
2170.Em n 2197.Ar n
2171trailing components if a digit 2198trailing components if a digit
2172.Em n 2199.Ar n
2173is given. 2200is given.
2174If 2201If
2175.Em n 2202.Ar n
2176begins with 2203begins with
2177.Sq 0 , 2204.Ql 0 ,
2178the number of skipped components precede the trailing component(s) in 2205the number of skipped components precede the trailing component(s) in
2179the format 2206the format
2180.\" ``/<number>trailing'' 2207.\" ``/<number>trailing''
2181.Do 2208.Do
2182.Sm off 2209.Sm off
2183.Li / Li < Va number Li > 2210.Li / Li < Ar number Li >
2184.Va trailing 2211.Ar trailing
2185.Sm on 2212.Sm on
2186.Dc 2213.Dc
2187(for 2214(for
2188.Sq \&%c ) 2215.Ql \&%c )
2189or 2216or
2190.\" ``...trailing'' 2217.\" ``...trailing''
2191.Dq Li \&... Ns Va trailing 2218.Dq Li \&... Ns Ar trailing
2192(for 2219(for
2193.Sq \&%. ) . 2220.Ql \&%. ) .
2194.It Li \&%M 2221.It Li \&%M
2195The remote host name. 2222The remote host name.
2196.It Li \&%m 2223.It Li \&%m
2197The remote host name, up to the first 2224The remote host name, up to the first dot
2198.Sq \&. . 2225.Ql \&. .
2199.It Li \&%n 2226.It Li \&%n
2200The remote user name. 2227The remote user name.
2201.It Li \&%% 2228.It Li \&%%
2202A single 2229A single percent character
2203.Sq % . 2230.Ql % .
2204.El 2231.El
2205.Sh ENVIRONMENT 2232.Sh ENVIRONMENT
2206.Nm 2233.Nm
2207uses the following environment variables. 2234uses the following environment variables.
2208.Bl -tag -width "FTPSERVERPORT" 2235.Bl -tag -width "FTPSERVERPORT"
2209.It Ev FTPANONPASS 2236.It Ev FTPANONPASS
2210Password to send in an anonymous 2237Password to send in an anonymous
2211.Tn FTP 2238.Tn FTP
2212transfer. 2239transfer.
2213Defaults to 2240Defaults to
2214.Dq Li `whoami`@ . 2241.Dq Li \&\`whoami\`@ .
2215.It Ev FTPMODE 2242.It Ev FTPMODE
2216Overrides the default operation mode. 2243Overrides the default operation mode.
2217Support values are: 2244Support values are:
2218.Bl -tag -width "passive" 2245.Bl -tag -width "passive"
2219.It Cm active 2246.It Cm active
2220active mode 2247active mode
2221.Tn FTP 2248.Tn FTP
2222only 2249only
2223.It Cm auto 2250.It Cm auto
2224automatic determination of passive or active (this is the default) 2251automatic determination of passive or active (this is the default)
2225.It Cm gate 2252.It Cm gate
2226gate-ftp mode 2253gate-ftp mode
2227.It Cm passive 2254.It Cm passive
2228passive mode 2255passive mode
2229.Tn FTP 2256.Tn FTP
2230only 2257only
2231.El 2258.El
2232.It Ev FTPPROMPT 2259.It Ev FTPPROMPT
2233Command-line prompt to use. 2260Command-line prompt to use.
2234Defaults to 2261Defaults to
2235.Dq "ftp> " . 2262.Sq Li ftp>\~ .
2236Refer to 2263Refer to
2237.Sx COMMAND LINE PROMPT 2264.Sx COMMAND LINE PROMPT
2238for more information. 2265for more information.
2239.It Ev FTPRPROMPT 2266.It Ev FTPRPROMPT
2240Command-line right side prompt to use. 2267Command-line right side prompt to use.
2241Defaults to 2268Defaults to empty string.
2242.Dq "" . 
2243Refer to 2269Refer to
2244.Sx COMMAND LINE PROMPT 2270.Sx COMMAND LINE PROMPT
2245for more information. 2271for more information.
2246.It Ev FTPSERVER 2272.It Ev FTPSERVER
2247Host to use as gate-ftp server when 2273Host to use as gate-ftp server when
2248.Ic gate 2274.Ic gate
2249is enabled. 2275is enabled.
2250.It Ev FTPSERVERPORT 2276.It Ev FTPSERVERPORT
2251Port to use when connecting to gate-ftp server when 2277Port to use when connecting to gate-ftp server when
2252.Ic gate 2278.Ic gate
2253is enabled. 2279is enabled.
2254Default is port returned by a 2280Default is port returned by a
2255.Fn getservbyname 2281.Xr getservbyname 3
2256lookup of 2282lookup of
2257.Dq ftpgate/tcp . 2283.Dq Li ftpgate/tcp .
2258.It Ev FTPUSERAGENT 2284.It Ev FTPUSERAGENT
2259The value to send for the 2285The value to send for the
2260.Tn HTTP 2286.Tn HTTP
2261User-Agent 2287User-Agent
2262header. 2288header.
2263.It Ev HOME 2289.It Ev HOME
2264For default location of a 2290For default location of a
2265.Pa .netrc 2291.Pa .netrc
2266file, if one exists. 2292file, if one exists.
2267.It Ev NETRC 2293.It Ev NETRC
2268An alternate location of the 2294An alternate location of the
2269.Pa .netrc 2295.Pa .netrc
2270file. 2296file.
@@ -2292,49 +2318,51 @@ for further notes about proxy use. @@ -2292,49 +2318,51 @@ for further notes about proxy use.
2292URL of 2318URL of
2293.Tn HTTP 2319.Tn HTTP
2294proxy to use when making 2320proxy to use when making
2295.Tn HTTP 2321.Tn HTTP
2296URL requests. 2322URL requests.
2297If proxy authentication is required and there is a username and 2323If proxy authentication is required and there is a username and
2298password in this URL, they will automatically be used in the first 2324password in this URL, they will automatically be used in the first
2299attempt to authenticate to the proxy. 2325attempt to authenticate to the proxy.
2300.Pp 2326.Pp
2301If 2327If
2302.Dq unsafe 2328.Dq unsafe
2303URL characters are required in the username or password 2329URL characters are required in the username or password
2304(for example 2330(for example
2305.Sq @ 2331.Ql @
2306or 2332or
2307.Sq / ) , 2333.Ql / ) ,
2308encode them with 2334encode them with
2309.Li RFC 3986 2335.Li RFC 3986
2310.Sq Li \&% Ns Ar XX 2336.Sq Li \&% Ns Ar XX
2311encoding. 2337encoding.
2312.Pp 2338.Pp
2313Note that the use of a username and password in 2339Note that the use of a username and password in
2314.Ev ftp_proxy 2340.Ev ftp_proxy
2315and 2341and
2316.Ev http_proxy 2342.Ev http_proxy
2317may be incompatible with other programs that use it 2343may be incompatible with other programs that use it
2318(such as 2344(such as
2319.Xr lynx 1 ) . 2345.Xr lynx 1 ) .
2320.Pp 2346.Pp
2321.Em NOTE : 2347.Em NOTE :
2322this is not used for interactive sessions, only for command-line 2348this is not used for interactive sessions, only for command-line
2323fetches. 2349fetches.
2324.It Ev no_proxy 2350.It Ev no_proxy
2325A space or comma separated list of hosts (or domains) for which 2351A space or comma separated list of hosts (or domains) for which
2326proxying is not to be used. 2352proxying is not to be used.
2327Each entry may have an optional trailing ":port", which restricts 2353Each entry may have an optional trailing
 2354.Sq Li \&: Ns Ar port ,
 2355which restricts
2328the matching to connections to that port. 2356the matching to connections to that port.
2329.El 2357.El
2330.Sh EXTENDED PASSIVE MODE AND FIREWALLS 2358.Sh EXTENDED PASSIVE MODE AND FIREWALLS
2331Some firewall configurations do not allow 2359Some firewall configurations do not allow
2332.Nm 2360.Nm
2333to use extended passive mode. 2361to use extended passive mode.
2334If you find that even a simple 2362If you find that even a simple
2335.Ic ls 2363.Ic ls
2336appears to hang after printing a message such as this: 2364appears to hang after printing a message such as this:
2337.Pp 2365.Pp
2338.Dl 229 Entering Extended Passive Mode (|||58551|) 2366.Dl 229 Entering Extended Passive Mode (|||58551|)
2339.Pp 2367.Pp
2340then you will need to disable extended passive mode with 2368then you will need to disable extended passive mode with