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

Re: path PATH

On Sat, Jan 21, 2023 at 10:54 AM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
> NUTS!  All the others, there's only one element so there's no chance for
> the colons to show up :(  they define as arrays, but there's actually
> just the one element so that's where I lost the scent.  I get it.  Many
> thanks.  So PATH is indeed unique but it isn't special :)

It's actually the other way around; it's special (because it cannot be
un-tied) but not unique.  These scalar variables are tied, exported,
and special:


These scalars are tied and special but not (by default) exported:


These all behave the same way with respect to the array value being
joined by colons to form the scalar value, and they all remain tied
even if you unset them (as in, both parts of each pair will reappear
as soon as you assign a value to either the scalar or the array).  The
reason for this tied behavior is so that the scalar parts CAN be
exported, because the environment cannot contain arrays.

Messages sorted by: Reverse Date, Date, Thread, Author