Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Tagged parameters
> On 15/08/2023 06:51 Marlon Richert <marlon.richert@xxxxxxxxx> wrote:
> man zshbuiltins says that `typeset -t` "tags the named parameters",
> but also that "tags have no special meaning to the shell."
>
> Is there a practical use case for this? Why was this implemented?
It's inherited from ksh.
It's useful if there are certain parameters you want to keep track
of e.g. for debugging, because you can ask the shell to show you all
tagged parameters instead of giving a list.
% typeset -t foo=one bar=two
% typeset -t
bar=two
foo=one
Saying they have "no special meaning to the shell" is perhaps not a
100% helpful description. since the fact of just having this option
associated with them is itself "special" in the way shown above.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author