Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: status and pipestatus



Here are a couple of examples where I don't want to use pipestatus.

Command: false | false; x=0
State after running the command: status=0, pipestatus=(1 1)

Command: true | true; x=$(false)
State after running the command: status=1, pipestatus=(0 0)

In these two examples status comes from x=..., while pipestatus comes
from the previous pipeline.

Roman.

On Sat, Jul 27, 2019 at 8:43 AM Roman Perepelitsa
<roman.perepelitsa@xxxxxxxxx> wrote:
>
> I'd like to use status and pipestatus special parameters in a precmd
> hook. There are cases where status gets updated between two precmd
> invocations but pipestatus doesn't. In such cases I don't want to use
> pipestatus. In other words, I want to use pipestatus if and only if it
> corresponds to the same command from which status was derived. Is this
> possible?
>
> Roman.



Messages sorted by: Reverse Date, Date, Thread, Author