Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: How to restore $? AND $_ ?
- X-seq: zsh-workers 44571
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: How to restore $? AND $_ ?
- Date: Wed, 24 Jul 2019 08:29:08 +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 :content-transfer-encoding; bh=sUyfFL2ejQfVIuOvym0ZfQyhkyxQeSfXket8EPhSOLQ=; b=b2sVcWcv3dkBAg516hsgvptAjWgbiTT1MxVOyEk//+5b8T0Qy6egamCduGlDgeVB+S sRLh8sFbmnBOJx7pdUuNFqaWgi7TN0Dxh0l5o2wK1ZJnUU7EK4bekwYttEFelcIfLbNC H56XYzxsLivbMLX4fb8n3Ta5wdQGM5Ab/gf0Wb9Ptgawgvcru+FQfVIEjFp1LXr9sC+H HcsjWLAVhaFc+PxnUoZifbGhtKdb1qLZmQrbPdSUkNippCxz5hghrtqorf1ViVXHcqs1 +LFwqZS8Nt9ezvzXZUZLBmvgm92eMTfxe1Den4CKt21SLAuMUEpVXGtgu5KuI+D9ZtRY o90g==
- In-reply-to: <CAKc7PVDqisHHAcJK06TaFmxCmmhdbYWTQUeBRsfaYu=A8xgvXA@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: <CAKc7PVDqisHHAcJK06TaFmxCmmhdbYWTQUeBRsfaYu=A8xgvXA@mail.gmail.com>
False alarm – Zsh pushes the $_ values onto some kind of stack:
() { : test2 } test1; echo $_
test1
so appending $_ to the sched's argument is sufficient.
On Wed, 24 Jul 2019 at 08:20, Sebastian Gniazdowski
<sgniazdowski@xxxxxxxxx> wrote:
>
> Hello,
> consider the following:
>
> sched-fun() {
> # UND=$_
> local ret=$?
>
> sched +1 "sched-fun \$_"
>
> # : $UND
> return $ret
> }
>
> The point is that the 2 commented lines must be run in the same place
> as the next lines after them in order to work. No way out of this
> problem? It is about not disrupting user session with background
> tasks, I think that this is in general important.
> --
> Sebastian Gniazdowski
> News: https://twitter.com/ZdharmaI
> IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
> Blog: http://zdharma.org
--
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org
Messages sorted by:
Reverse Date,
Date,
Thread,
Author