Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: $? being clobbered?
- X-seq: zsh-users 6397
- From: Michał Politowski <mpol@xxxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: $? being clobbered?
- Date: Mon, 14 Jul 2003 19:57:27 +0200
- In-reply-to: <20030714173555.GA4352@xxxxxxxxxxxxxxxxxxxxxxxx>
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20030714173555.GA4352@xxxxxxxxxxxxxxxxxxxxxxxx>
On Mon, 14 Jul 2003 13:35:56 -0400, Phil!Gregory wrote:
> I'm having a problem with zsh, and am not sure if it's a bug or a
> feature. If I have a program executed in my prompt, its return status
> clobbers the value of $?, which isn't really what I want. Example:
>
> > PROMPT='> '
> > perl -e 'exit 42'
> > echo $?
> 42
> > PROMPT='%{$(echoti cub 80)%}> '
> > perl -e 'exit 42'
> > echo $?
> 0
>
> Is there some way to fix this?
You can hack around this with
$(R=$?;echoti cub 80;return $R)
--
Michał Politowski -- mpol@xxxxxxxxxxxxxxxxxxx
Warning: this is a memetically modified message
Messages sorted by:
Reverse Date,
Date,
Thread,
Author