Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PRINT_EXIT_VALUE problems
- X-seq: zsh-users 16672
- From: Nathan Dorfman <na@xxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: PRINT_EXIT_VALUE problems
- Date: Wed, 28 Dec 2011 11:26:01 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=gmIMTZ3Tx3P+omX1Req0IT9Ahvb5VmczOS+deadOUe0=; b=Xkw972bjjlVMbDTZhCPmaVHATGv10MRViukYPQM306ZKAAWIkegaNAwvj2poAWpOeC oO8zEdXDF8Iwbty+WGxs4tt0wLdsiO5RFv9RKAfEakRm5ofogVlV/I7iWikaipldyeSr TeWGkZOIbtWJjA/DqRvWIHCiVbS10bbbfAl6k=
- In-reply-to: <20111224111347.GE3506@xvii.vinc17.org>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20111224111347.GE3506@xvii.vinc17.org>
- Sender: ndorfman@xxxxxxxxx
On Sat, Dec 24, 2011 at 6:13 AM, Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
> Hi,
>
> This is not new, but there are two problems with the PRINT_EXIT_VALUE
> option. They can be shown on the following example (under Debian):
>
> $ zsh-beta -f
> xvii% echo $ZSH_VERSION
> 4.3.15-dev-0-cvs1220
> xvii% setopt PRINT_EXIT_VALUE
> xvii% false || true
> zsh: exit 1
> xvii%
Unrelated to the apparent bug you've described, I've been using a
different mechanism to achieve the effect that (I think) you want. $?
does the right thing:
% false || true ; echo $?
0
% false && true ; echo $?
1
You can use the %? sequence in your prompt to see the exit value; what
I do is actually use the following:
%(?// %?? )
This expands to " 1? " after false && true, and the empty string ""
after false || true. I find this really handy as the prompt is
different enough to draw my attention after a non-zero exit status.
Hope this helps,
-nd.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author