Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: A way to untie -T vars?
- X-seq: zsh-users 28692
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>, Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: A way to untie -T vars?
- Date: Sat, 21 Jan 2023 18:15:39 +0100
- Archived-at: <https://zsh.org/users/28692>
- 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 5:56 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Sat, Jan 21, 2023 at 8:38 AM Sebastian Gniazdowski
> <sgniazdowski@xxxxxxxxx> wrote:
> >
> > 'm using -U flag to quickly uniquify the scalar, however this method is problematic as the array vars are left over.
>
> I don't follow what this is intended to accomplish?
While trying to understand what Sebastian meant I've accidentally
discovered an unorthodox way to unset a parameter.
unset2() {
local _"$1"
typeset -gT _"$1" "$1"
}
Test:
% foo=hello
% unset2 foo
% typeset -p foo
typeset: no such variable: foo
I sort of understand why that happens but it doesn't look intended.
Roman.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author