Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: A way to untie -T vars?
- X-seq: zsh-users 28691
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: A way to untie -T vars?
- Date: Sat, 21 Jan 2023 09:11:12 -0800
- Archived-at: <https://zsh.org/users/28691>
- In-reply-to: <CAH+w=7YY5F_ZYJgivw9PSjt8PTQ9R+gHF3jnjbBw-LLkEnc2zg@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CAKc7PVDEmKnY9TiYwaAgvzXEqNhLwZo46paUPjJOz9HsU3_djg@mail.gmail.com> <CAH+w=7YY5F_ZYJgivw9PSjt8PTQ9R+gHF3jnjbBw-LLkEnc2zg@mail.gmail.com>
On Sat, Jan 21, 2023 at 8:55 AM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Sat, Jan 21, 2023 at 8:38 AM Sebastian Gniazdowski
> <sgniazdowski@xxxxxxxxx> wrote:
> >
> > maybe there's a graceful way of untying the vars?
>
> There's not.
There's this (unclear if "graceful"):
% typeset -a FOO=($FOO) foo=($foo)
This effectively unsets both variables and then immediately resets
them to their previous values ... except that it also converts the
scalar into a one-element array. For most purposes that will work the
same, but not always.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author