bug-bash
[Top][All Lists]
Advanced

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

Re: How to deal with errors in <()?


From: Chet Ramey
Subject: Re: How to deal with errors in <()?
Date: Tue, 10 Mar 2015 11:29:35 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.5.0

On 3/9/15 6:19 PM, Peng Yu wrote:
>>
>>> $ bash --norc
>>> bash-4.3$ echo <(exit 123)
>>> /dev/fd/63
>>> bash-4.3$ echo "$!"
>>> 12142
>>> bash-4.3$ wait "$!"
>>> bash: wait: pid 12142 is not a child of this shell
>>>
>>> Having the process substitution pid in $! is not very useful if
>>> you can't wait for it to retrieve the status.
>>
>> I agree.  I will look at making that work for the next release of bash.
> 
> Would making an environment array (just as PIPE_STATUS) that will be
> expanded to the process IDs of the all executed background commands
> started from the last command be helpful to my original question? (But
> this should also work with commands connected by pipes in order to
> solve the problem.)

Doing something like that would be much more complicated and take much
more code (and bookkeeping) to implement.  If you'd like to take a shot
at creating a data structure to keep track of that information and a way
to expose it to a script writer, please do, and I will look at what you
come up with.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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