Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: print_exit_value unset in an scheduled function, yet still active
- X-seq: zsh-workers 44778
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- Subject: Re: print_exit_value unset in an scheduled function, yet still active
- Date: Thu, 26 Sep 2019 12:49:37 -0700
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=t36s7vOG6DXPnZUOCF7sgwf2Wd7HVFVDI125ZMWHQi4=; b=sgylOS1tWb+Jmf4d8MJyX0E1IAxMQ08ycJ2+mj2DTpzE3RoUL+BvgFImzVzsBZglFc O9fo/3ktBIftES7jsoybgfNL4XpTj844lIXTnDksRI/pKRrJ/v87f+1OUQ6jX1ifRmwo Y0ageCBpnnckJ7KjiP5imDV2ZDoM2VEo16uUvNyz6c+m1xc8xGzI9AfjVXvZP1pug16Q Xcf/tOg06FaoNgR7wFaGPYd7mmScktR8Bwv0/CYkjSAEEL8TF/RiVQYenQn+n7kFNp2e yA0hAfH5+zFE4pmyfvPyo0kvlbDMbBwHQ3YnCjIE80KZ8Pb2R3EYlWz0OrclRmNXbnJK i1Aw==
- In-reply-to: <CAKc7PVBKO33b4rr-Bs3p18KKp1bcnLgtNhyuKjU-y1sB2k1aLQ@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVBKO33b4rr-Bs3p18KKp1bcnLgtNhyuKjU-y1sB2k1aLQ@mail.gmail.com>
On Thu, Sep 26, 2019 at 12:23 PM Sebastian Gniazdowski
<sgniazdowski@xxxxxxxxx> wrote:
>
> Hello,
> func() { print $options[printexitvalue] $options[shglob]; false }
> setopt printexitvalue; sched +0 func
>
>
> So the printexitvalue is unset inside the scheduled function, yet it's
> still being active (outside?).
I'm not sure which part you think is wrong here.
Even if, inside the function, printexitvalue is not active, the
function itself returns nonzero here, because "false" is the last
statement; so that exit value will be printed even though the exit
value of "false" is not.
If the question instead is "why did printexitvalue become unset inside
the function": It's always turned off on entry to a function, so that
only the exit value of the function itself will later be printed,
exactly as happened here.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author