bug-bash
[Top][All Lists]
Advanced

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

Re: Silent errors in process substitution


From: Greg Wooledge
Subject: Re: Silent errors in process substitution
Date: Wed, 15 Apr 2009 09:22:42 -0400
User-agent: Mutt/1.4.2.2i

On Wed, Apr 15, 2009 at 02:46:45PM +0200, Anakim Border wrote:
> is there any way to notice commands exiting with a non-zero status
> inside a process substitution?
> 
> For example:
> 
> $ cat <(exit 1)
> 
> ignores the exit status of "exit":

The whole point of the process substitution syntax is that it gives you
a no-frills, anonymous named pipe without forcing you to bother about
mundane details such as where in the file system to place it.

If you actually care about the process on the other side of the named
pipe, and how it exits, then you should forego the process substitution
syntax altogether, make your own named pipe, launch your own child
process to interact with it, and use the 'wait' builtin to collect its
exit status at the appropriate time.




reply via email to

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