Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: local unfunction
- X-seq: zsh-users 23293
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: local unfunction
- Date: Fri, 30 Mar 2018 22:23:20 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=U9vVZeFgCGbwpiCGkGLj6v0Mwp2/lzetosCgFFOf9uE=; b=DUhmqdFRzvVJuGGCa/BA70+hqPSaRkPPXcjHYacg7j5B5sB0+PIp7Ca9VgzuVZ1Gg+ 3qF+OIkdmVwRR5kEeGRnrfI2uk2FepNqQuBdQ2nXEG0ypkzVmJ6U+c556IlJaQzTeaSC lr9pRR0SnAPypdAKVZUSVyp++o4VJdNFQdNmIGx5fxrLQZZVxgvIPJR2c5FUJAklTkE6 umrrIgQYiSPS3rW/sjb5sROvoca66x6GohOXr6Dz8OGjEKHCSkz2MZoMuTgHA4tP2Ezl zm5ZoNo0GoYkUYng6t0EoVN9HQHBzH1PvKAzR5JFnporjoCBhZn1L97t1YP/aaMP2HRf 1a/g==
- In-reply-to: <03b1320b-c248-adbe-55a3-49a3673453bd@eastlink.ca>
- 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: <9e0faf6b-b19e-b6d6-0eb7-6ea20b2c2154@eastlink.ca> <CAH+w=7aY8CTAKDUO1cyOACYUUATtiKGJAMYutYuh=acMozTxGw@mail.gmail.com> <03b1320b-c248-adbe-55a3-49a3673453bd@eastlink.ca>
On Fri, Mar 30, 2018 at 5:30 PM, Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
>
> playing with Mikael's use of parenthesis -- I'd swear this is the first time
> I've seen any such thing -- and it seems too good to be true, so far it just
> works. Are there any lurking gotchas?
It's just creating a subshell, like any other time you'd put one or
more commands in parentheses.
The "lurking gotcha" is that because it is a subshell it can't affect
the parent shell in any way. That's what Mikael means by "cancel all
other side effects" which he demonstrates with a=5.
> Disadvantages? It doesn't seem any slower.
It does fork an additional process.
> BTW, just to keep flogging a dead horse:
>
> function test1 ()
> {
> echo "\none"
> whence -a "zsh"
> echo "\ntwo"
> whence -ma "zsh*"
> echo "\nthree"
> whence -m "zsh*"
> }
Try adding -w to get whence to tell you which hash table it's reading from.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author