Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: A way to untie -T vars?



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