bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: a patch to fix sh_stat on SunOS


From: Dmitry Goncharov
Subject: Re: a patch to fix sh_stat on SunOS
Date: Sat, 20 Aug 2016 21:31:51 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Aug 11, 2016 at 07:52:51AM -0400, Chet Ramey wrote:
> On 8/10/16 5:38 PM, Dmitry Goncharov wrote:
> 
> >> > does "If any file argument to one of the primaries is of the form
> > 
> >> > /dev/fd/n, then file descriptor n is checked.".
> > 
> > 
> >> It seems like a documentation error.
> > 
> > What should the man page say instead?
> 
> Probably something close to what the current text about using /dev/fd in
> redirections says, maybe:

Do you mean current text in process substitution?

The current text in redirection says
"/dev/fd/fd
    If fd is a valid integer, file descriptor fd is duplicated."

There is asymmetry
>/dev/fd/6 redirects to fd 6, while
test -p /dev/fd/6 tests file "/dev/fd/6".


> 
> \fBBash\fP handles filenames of the form \fI/dev/fd\fP specially when they
> are used as arguments to unary operators.
> If the operating system on which \fBbash\fP is running provides these
> special files, bash will use them; otherwise if
> any \fIfile\fP argument to one of the primaries is of the form
> \fI/dev/fd/n\fP, then file descriptor \fIn\fP is checked.

With this new contract how can the user write portable bash code which tests if
a fd refers to a pipe?

regards, Dmitry



reply via email to

[Prev in Thread] Current Thread [Next in Thread]