From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: Correct way to set environment
Date: Sat, 15 Dec 2012 11:34:22 -0800 [thread overview]
Message-ID: <121215113422.ZM32237@torch.brasslantern.com> (raw)
In-Reply-To: <20121215183339.5e22fc1c@pws-pc.ntlworld.com>
In-Reply-To: <121215111934.ZM32088@torch.brasslantern.com>
On Dec 15, 6:33pm, Peter Stephenson wrote:
}
} (iii) you don't want the paths to keep getting extended with repeated
} values: for this, zsh has the -U (unique) keyword. It only works on
} colon-separated arrays if the shell knows that's what they are.
On Dec 15, 11:19am, Bart Schaefer wrote:
}
} Zsh then collapses duplicates out of the arrays and updates the "tied"
} strings to match. Note, however, that if you assign directly to the
} string variable instead of assigning to the array, then zsh does NOT
} apply the uniqueness property, so you must remember to use the array
} assignment form after tying.
Apparently I get to learn (or re-learn) something today as well.
I've never to my recollection attempted to apply -U to the string part
of a tied pair. So my statement above applies only when the array part
has been declared unique but the string part has not.
(Most likely this is because my .zsh* files are written to work with any
version clear back to 2.4 from the mid-90s, and -U was not originally a
property of scalar variables.)
prev parent reply other threads:[~2012-12-15 19:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-15 13:29 Florian Lindner
2012-12-15 13:44 ` Stefan Marx
2012-12-15 18:33 ` Peter Stephenson
2012-12-15 18:42 ` Philippe Troin
2012-12-15 19:19 ` Bart Schaefer
2012-12-15 19:34 ` Bart Schaefer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=121215113422.ZM32237@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).