diff mbox

[MAN] Clarify two redirection mechanisms

Message ID 1416570754-9998-1-git-send-email-saulery@free.fr (mailing list archive)
State Changes Requested
Delegated to: Herbert Xu
Headers show

Commit Message

Stéphane Aulery Nov. 21, 2014, 11:52 a.m. UTC
From: Stéphane Aulery <saulery@free.fr>

Close Debian Bug #501566
---
 src/dash.1 | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Herbert Xu Dec. 1, 2014, 10:04 a.m. UTC | #1
saulery@free.fr wrote:
> From: Stéphane Aulery <saulery@free.fr>
> 
> Close Debian Bug #501566
> ---
> src/dash.1 | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/src/dash.1 b/src/dash.1
> index d782882..429657a 100644
> --- a/src/dash.1
> +++ b/src/dash.1
> @@ -402,11 +402,13 @@ Append standard output (or n) to file.
> .It [n] Ns \*[Lt] file
> Redirect standard input (or n) from file.
> .It [n1] Ns \*[Lt]& Ns n2
> -Duplicate standard input (or n1) from file descriptor n2.
> +Redirect standard input (or fd n1) from the same resource as currently open on
> +fd n2.

"Resource" is rather unwieldy, how about simply "file"?

Thanks,
Stephane Chazelas Dec. 1, 2014, 12:27 p.m. UTC | #2
2014-12-01 18:04:56 +0800, Herbert Xu:
[...]
> > --- a/src/dash.1
> > +++ b/src/dash.1
> > @@ -402,11 +402,13 @@ Append standard output (or n) to file.
> > .It [n] Ns \*[Lt] file
> > Redirect standard input (or n) from file.
> > .It [n1] Ns \*[Lt]& Ns n2
> > -Duplicate standard input (or n1) from file descriptor n2.
> > +Redirect standard input (or fd n1) from the same resource as currently open on
> > +fd n2.
> 
> "Resource" is rather unwieldy, how about simply "file"?
[...]

"file" could be misleading (as actually it's dup(2)ing a file
descriptor, so more like redirecting to same _open file
description_ (not the same as reopening the file like "n1>
/dev/fd/n2" does on Linux for instance) and "file" is understood
by many as "regular file" while here, it could be (and often is)
socket/pipe/devices...).

IMO, "resource" is vague enough so as not to give the wrong idea
and I like that wording because it conveys the intended
mechanism clearly ("redirect to same thing as"). But I agree
it's not ideal.

The "dupliciting fd x onto y" wording may be more correct, but
doesn't convey the redirection idea as clearly IMO.
diff mbox

Patch

diff --git a/src/dash.1 b/src/dash.1
index d782882..429657a 100644
--- a/src/dash.1
+++ b/src/dash.1
@@ -402,11 +402,13 @@  Append standard output (or n) to file.
 .It [n] Ns \*[Lt] file
 Redirect standard input (or n) from file.
 .It [n1] Ns \*[Lt]& Ns n2
-Duplicate standard input (or n1) from file descriptor n2.
+Redirect standard input (or fd n1) from the same resource as currently open on
+fd n2.
 .It [n] Ns \*[Lt]&-
 Close standard input (or n).
 .It [n1] Ns \*[Gt]& Ns n2
-Duplicate standard output (or n1) to n2.
+Redirect standard output (or fd n1) to the same resource as currently open on
+fd n2.
 .It [n] Ns \*[Gt]&-
 Close standard output (or n).
 .It [n] Ns \*[Lt]\*[Gt] file