Hi, Frederic Nowak wrote on Tue, Nov 03, 2015 at 04:59:35PM +0100:
> I think the "dir |more" example in ftp.1 is not working as intended. True. > ls (and by extension its synonym dir) expects to be called like this: > > ls [remote-directory [local-file]] > > Therefore, "dir |more" would print the contents of a remote directory > called "|more", which usually doesn't exist. I think the example is > supposed to be "dir . |more" which pipes the contents of the current > directory to more. > > The first patch below changes "dir |more" to "dir . |more". The second > patch changes it to "ls . |more", in case ls should be preferred over > its synonym dir. The fix seems correct, i'd like to commit it in the following form, also clarifying that special handling of `-' and `|' only applies to local file names, not to remote file names. Note that item 5 does talk about remote file names, so it's not an option to simply change the first word for the whole "FILE NAMING CONVENTIONS" section to "Local files". OK? Ingo Index: ftp.1 =================================================================== RCS file: /cvs/src/usr.bin/ftp/ftp.1,v retrieving revision 1.100 diff -u -p -r1.100 ftp.1 --- ftp.1 25 Sep 2015 20:32:39 -0000 1.100 +++ ftp.1 4 Nov 2015 14:01:13 -0000 @@ -1461,13 +1461,13 @@ Files specified as arguments to commands are processed according to the following rules. .Bl -enum .It -If the file name +If .Sq - -is specified, the standard input (for reading) +is specified as a local file name, the standard input (for reading) or standard output (for writing) is used. .It -If the first character of the file name is +If the first character of a local file name is .Sq \&| , the remainder of the argument is interpreted as a shell command. @@ -1481,7 +1481,7 @@ must be quoted; e.g., .Qq ls -lt . A particularly useful example of this mechanism is: -.Qq dir |more . +.Qq ls \&. |more . .It Failing the above checks, if .Dq globbing > Index: usr.bin/ftp/ftp.1 > =================================================================== > RCS file: /cvs/src/usr.bin/ftp/ftp.1,v > retrieving revision 1.100 > diff -u -p -r1.100 ftp.1 > --- usr.bin/ftp/ftp.1 25 Sep 2015 20:32:39 -0000 1.100 > +++ usr.bin/ftp/ftp.1 3 Nov 2015 15:31:04 -0000 > @@ -1481,7 +1481,7 @@ must be quoted; e.g., > .Qq ls -lt . > A particularly > useful example of this mechanism is: > -.Qq dir |more . > +.Qq dir \&. |more . > .It > Failing the above checks, if > .Dq globbing > > > Index: usr.bin/ftp/ftp.1 > =================================================================== > RCS file: /cvs/src/usr.bin/ftp/ftp.1,v > retrieving revision 1.100 > diff -u -p -r1.100 ftp.1 > --- usr.bin/ftp/ftp.1 25 Sep 2015 20:32:39 -0000 1.100 > +++ usr.bin/ftp/ftp.1 3 Nov 2015 15:31:04 -0000 > @@ -1481,7 +1481,7 @@ must be quoted; e.g., > .Qq ls -lt . > A particularly > useful example of this mechanism is: > -.Qq dir |more . > +.Qq ls \&. |more . > .It > Failing the above checks, if > .Dq globbing