Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: status and pipestatus
- X-seq: zsh-users 24098
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: status and pipestatus
- Date: Sat, 27 Jul 2019 09:21:52 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=kY1kT965gNTp9UGGB2Yb5MNn9Wd2WidS8sGnuk9X9yc=; b=sWJuHethUA5lmvVLeznVyuvCmtHfiLObCVKQe5OvFlfqNTteWFMe3gH85kjrC5Ih08 tegpmnySF+I2+3W3pK24euMttSZIkD1N0ORkHKBpZWAU4UO8azlDvYrmXTCl4Hw5S1kk gG72KTKadr7JeysiEGkcqZ3rj8n0ZTUOSQt10jzr0T56KD/9t7ryUHg5n2YAF+HUN+a2 51Zlj2rOlit5GgYNGLcdIxyOS2YU8ZSGGhD33De8ymdmfFYBbCIIldrQ6kqqUs/HZ77l AQkaKCTYCuRp6uKwtSS8a0bwl8Y4hAgkPGfFLyWp27oYLMd9o6e+ZfFNgATH9S2Xug8K +LKw==
- In-reply-to: <CAN=4vMpGHeXqLFkMpfzZyYr8=GScFymvDSwsUsvJpNipdkJ_nA@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAN=4vMpGHeXqLFkMpfzZyYr8=GScFymvDSwsUsvJpNipdkJ_nA@mail.gmail.com>
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