dash.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bug#501566: [MAN] Clarify two redirection mechanisms
@ 2014-12-08 18:50 Stéphane Aulery
  2014-12-08 20:37 ` Stephane CHAZELAS
  0 siblings, 1 reply; 10+ messages in thread
From: Stéphane Aulery @ 2014-12-08 18:50 UTC (permalink / raw)
  To: 501566, dash, stephane.chazelas

Hello,

Stéphane Chazelas said:
> Herbert Xu said:
>>
>> "Resource" is rather unwieldy, how about simply "file"?
>
> "file" could be misleading
>
> [...]
>
> 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.

It is true that "resource" is dissonant as "file" is too restrictive. The
term "file descriptor" is used above. Why not use it again?

Regards,

-- 
Stéphane Aulery


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Bug#501566: [MAN] Clarify two redirection mechanisms
  2014-12-08 18:50 Bug#501566: [MAN] Clarify two redirection mechanisms Stéphane Aulery
@ 2014-12-08 20:37 ` Stephane CHAZELAS
  2014-12-08 21:22   ` Stéphane Aulery
  0 siblings, 1 reply; 10+ messages in thread
From: Stephane CHAZELAS @ 2014-12-08 20:37 UTC (permalink / raw)
  To: Stéphane Aulery, 501566; +Cc: dash

2014-12-08 19:50:05 +0100, Stéphane Aulery:
>>>> [n1]>&n2    Redirect standard output (or fd n1) to the same "open
>>>>             file description" as on fd n2.
>>>> 
>>>> [n1]>&n2    Copy fd n2 as stdout (or fd n1)
>>>> 
>>>> [n1]>&n2    Redirect standard output (or fd n1) to the same
>>>>             resource as currently open on fd n2.

> >> "Resource" is rather unwieldy, how about simply "file"?
> >
> > "file" could be misleading
> >
> > [...]
> >
> > 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.
> 
> It is true that "resource" is dissonant as "file" is too restrictive. The
> term "file descriptor" is used above. Why not use it again?
[...]

If you say redirect fd n1 to fd n2, you confuse people (and I've
seen a lot of people being confused in such a way) as they
start thinking the fds become somehow linked (for instance that
in 2>&1 > file, stderr goes to stdout and then both to "file"
which is not the case). When you start thinking of "&" as
"/address/ of" (yet another improper wording) or "resource
currently open on", that clears that confusion.

If you don't like the "resource" wording, you can always got for
the "copy" one above or the POSIX wording:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_07_05

I've seen "resource" used in the past, I've used it myself a few
times in usenet articles:

https://groups.google.com/d/msg/comp.unix.shell/48beJpLdjNE/jUak98HUekUJ
https://groups.google.com/d/msg/comp.unix.questions/EQL477tzYKk/J9ysMfqc5YIJ
https://groups.google.com/d/msg/comp.unix.aix/WcWsocnEHS0/hgSDWt19SaYJ

(see the aforementioned confusion in some of the messages that
those were replying to).

-- 
Stephane

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Bug#501566: [MAN] Clarify two redirection mechanisms
  2014-12-08 20:37 ` Stephane CHAZELAS
@ 2014-12-08 21:22   ` Stéphane Aulery
  2014-12-08 21:56     ` Jonathan Nieder
  2014-12-09 16:54     ` Bug#501566: " Stephane CHAZELAS
  0 siblings, 2 replies; 10+ messages in thread
From: Stéphane Aulery @ 2014-12-08 21:22 UTC (permalink / raw)
  To: Stephane CHAZELAS; +Cc: 501566, dash

Le lundi 08 décembre 2014 à 08:37:38, Stephane CHAZELAS a écrit :
> 2014-12-08 19:50:05 +0100, Stéphane Aulery:
> >>>> [n1]>&n2    Redirect standard output (or fd n1) to the same "open
> >>>>             file description" as on fd n2.
> >>>> 
> >>>> [n1]>&n2    Copy fd n2 as stdout (or fd n1)
> >>>> 
> >>>> [n1]>&n2    Redirect standard output (or fd n1) to the same
> >>>>             resource as currently open on fd n2.
> 
> > >> "Resource" is rather unwieldy, how about simply "file"?
> > >
> > > "file" could be misleading
> > >
> > > [...]
> > >
> > > 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.
> > 
> > It is true that "resource" is dissonant as "file" is too restrictive. The
> > term "file descriptor" is used above. Why not use it again?
> [...]
> 
> If you say redirect fd n1 to fd n2, you confuse people (and I've
> seen a lot of people being confused in such a way) as they
> start thinking the fds become somehow linked (for instance that
> in 2>&1 > file, stderr goes to stdout and then both to "file"
> which is not the case). When you start thinking of "&" as
> "/address/ of" (yet another improper wording) or "resource
> currently open on", that clears that confusion.
> 
> If you don't like the "resource" wording, you can always got for
> the "copy" one above or the POSIX wording:
> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_07_05

As for me, I'm not bothered by the word "resource". It's ok for me as
"copy". But Herbert does not agree, so I can not force him:-)).

I wonder more and more if Herbert is willing to accept this tiny patch
or another. I would not be wasting his time if he does not want or can
not take care of that. This is free software, there is no obligation.

This is my last attempt, if there is no consensus I close the bug
regarding Debian.

Have a nice day.

-- 
Stéphane Aulery

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [MAN] Clarify two redirection mechanisms
  2014-12-08 21:22   ` Stéphane Aulery
@ 2014-12-08 21:56     ` Jonathan Nieder
  2014-12-08 22:15       ` Stéphane Aulery
  2014-12-09 16:54     ` Bug#501566: " Stephane CHAZELAS
  1 sibling, 1 reply; 10+ messages in thread
From: Jonathan Nieder @ 2014-12-08 21:56 UTC (permalink / raw)
  To: Stéphane Aulery; +Cc: Stephane CHAZELAS, 501566, dash

Hi Stéphane,

Stéphane Aulery wrote:

> As for me, I'm not bothered by the word "resource". It's ok for me as
> "copy". But Herbert does not agree, so I can not force him:-)).
[...]
> This is my last attempt, if there is no consensus I close the bug
> regarding Debian.

Please don't.  I can handle the bug if no one is able to come up with
a good wording.

Thanks,
Jonathan

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [MAN] Clarify two redirection mechanisms
  2014-12-08 21:56     ` Jonathan Nieder
@ 2014-12-08 22:15       ` Stéphane Aulery
  0 siblings, 0 replies; 10+ messages in thread
From: Stéphane Aulery @ 2014-12-08 22:15 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: Stephane CHAZELAS, 501566, dash

Hi Jonathan,

Le lundi 08 décembre 2014 à 01:56:15, Jonathan Nieder a écrit :
> 
> Stéphane Aulery wrote:
> 
> > As for me, I'm not bothered by the word "resource". It's ok for me as
> > "copy". But Herbert does not agree, so I can not force him:-)).
> [...]
> > This is my last attempt, if there is no consensus I close the bug
> > regarding Debian.
> 
> Please don't.  I can handle the bug if no one is able to come up with
> a good wording.

And how will you do if no one has a good wording?

I am willing to wait.

Regards,

-- 
Stéphane Aulery

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Bug#501566: [MAN] Clarify two redirection mechanisms
  2014-12-08 21:22   ` Stéphane Aulery
  2014-12-08 21:56     ` Jonathan Nieder
@ 2014-12-09 16:54     ` Stephane CHAZELAS
  2014-12-11  6:06       ` Herbert Xu
  2014-12-11  9:03       ` saulery
  1 sibling, 2 replies; 10+ messages in thread
From: Stephane CHAZELAS @ 2014-12-09 16:54 UTC (permalink / raw)
  To: Stéphane Aulery; +Cc: 501566, dash

2014-12-08 22:22:03 +0100, Stéphane Aulery:
> Le lundi 08 décembre 2014 à 08:37:38, Stephane CHAZELAS a écrit :
> > 2014-12-08 19:50:05 +0100, Stéphane Aulery:
> > >>>> [n1]>&n2    Redirect standard output (or fd n1) to the same "open
> > >>>>             file description" as on fd n2.
> > >>>> 
> > >>>> [n1]>&n2    Copy fd n2 as stdout (or fd n1)
[...]
> I wonder more and more if Herbert is willing to accept this tiny patch
> or another. I would not be wasting his time if he does not want or can
> not take care of that. This is free software, there is no obligation.
[...]

What matters here is the mistake fixed in the manual. n>&p has
been around since the end of the 70s. It's unlikely anyone will
learn anything about it from the dash man page. 

Let's make it:

  [n1]>&n2    Copy file descriptor n2 as stdout (or fd n1)
  [n1]<&n2    Copy file descriptor n2 as stdin (or fd n1)

That's more or less the POSIX wording. It may not be as
descriptive as other ones, but I can't imagine anyone
complaining about the correctness or accuracy of it.

-- 
Stephane

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Bug#501566: [MAN] Clarify two redirection mechanisms
  2014-12-09 16:54     ` Bug#501566: " Stephane CHAZELAS
@ 2014-12-11  6:06       ` Herbert Xu
  2014-12-11  9:03       ` saulery
  1 sibling, 0 replies; 10+ messages in thread
From: Herbert Xu @ 2014-12-11  6:06 UTC (permalink / raw)
  To: Stephane CHAZELAS; +Cc: saulery, 501566, dash

Stephane CHAZELAS <stephane.chazelas@gmail.com> wrote:
>
> Let's make it:
> 
>  [n1]>&n2    Copy file descriptor n2 as stdout (or fd n1)
>  [n1]<&n2    Copy file descriptor n2 as stdin (or fd n1)
> 
> That's more or less the POSIX wording. It may not be as
> descriptive as other ones, but I can't imagine anyone
> complaining about the correctness or accuracy of it.

Yes this sounds good to me.  Someone please create a patch for
it.

BTW, one of you guys dropped me from the CC list again.  Please
don't do that.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [MAN] Clarify two redirection mechanisms
  2014-12-09 16:54     ` Bug#501566: " Stephane CHAZELAS
  2014-12-11  6:06       ` Herbert Xu
@ 2014-12-11  9:03       ` saulery
  2014-12-25 22:51         ` Herbert Xu
  1 sibling, 1 reply; 10+ messages in thread
From: saulery @ 2014-12-11  9:03 UTC (permalink / raw)
  To: herbert; +Cc: dash, Stéphane Aulery

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.
+Copy file descriptor n2 as stdout (or fd n1).
+fd n2.
 .It [n] Ns \*[Lt]&-
 Close standard input (or n).
 .It [n1] Ns \*[Gt]& Ns n2
-Duplicate standard output (or n1) to n2.
+Copy file descriptor n2 as stdin (or fd n1).
+fd n2.
 .It [n] Ns \*[Gt]&-
 Close standard output (or n).
 .It [n] Ns \*[Lt]\*[Gt] file
-- 
2.1.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [MAN] Clarify two redirection mechanisms
  2014-12-11  9:03       ` saulery
@ 2014-12-25 22:51         ` Herbert Xu
  2014-12-26 11:35           ` Stéphane Aulery
  0 siblings, 1 reply; 10+ messages in thread
From: Herbert Xu @ 2014-12-25 22:51 UTC (permalink / raw)
  To: saulery; +Cc: dash

On Thu, Dec 11, 2014 at 10:03:06AM +0100, saulery@free.fr wrote:
> From: Stéphane Aulery <saulery@free.fr>
> 
> Close Debian Bug #501566

Patch applied.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [MAN] Clarify two redirection mechanisms
  2014-12-25 22:51         ` Herbert Xu
@ 2014-12-26 11:35           ` Stéphane Aulery
  0 siblings, 0 replies; 10+ messages in thread
From: Stéphane Aulery @ 2014-12-26 11:35 UTC (permalink / raw)
  To: Herbert Xu; +Cc: dash

Le vendredi 26 décembre 2014 à 09:51:47, Herbert Xu a écrit :
> On Thu, Dec 11, 2014 at 10:03:06AM +0100, saulery@free.fr wrote:
> > From: Stéphane Aulery <saulery@free.fr>
> > 
> > Close Debian Bug #501566
> 
> Patch applied.

Thanks a lot, Herbert, and a merry Christmas to you !

-- 
Stéphane Aulery

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-12-26 11:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-08 18:50 Bug#501566: [MAN] Clarify two redirection mechanisms Stéphane Aulery
2014-12-08 20:37 ` Stephane CHAZELAS
2014-12-08 21:22   ` Stéphane Aulery
2014-12-08 21:56     ` Jonathan Nieder
2014-12-08 22:15       ` Stéphane Aulery
2014-12-09 16:54     ` Bug#501566: " Stephane CHAZELAS
2014-12-11  6:06       ` Herbert Xu
2014-12-11  9:03       ` saulery
2014-12-25 22:51         ` Herbert Xu
2014-12-26 11:35           ` Stéphane Aulery

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).