Subject: Re: Re: [ast-users] aborting a pipeline?
--------

> how about using set -o pipefail ?
> 
> from man ksh :
> 
> The exit status of a pipeline is the exit status of the last command
> unless the pipefail option is enabled.
> 
> pipefail
>         A  pipeline  will  not complete until all compoâ
>         nents of the pipeline have  completed,  and  the
>         return  value will be the value of the last non-
>         zero command to fail or zero if no  command  has
>         failed.
> 
> w/o pipefail :
> 
> 

I suspect that the user who posted the query wanted the pipeline
to complete as soon as there was a failure.  With set -o pipefail,

        false | sleep 5

will take 5 seconds until the failure happens.

Maybe for pipefail, it would make sense to kill all processes in
the pipeline once any one of them fails, but that is not what
currently happens.


David Korn
[email protected]
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to