zsh-users
 help / color / mirror / code / Atom feed
* Effect of typeset -U for colon separated paths?
@ 2001-12-14 13:00 Hannu Koivisto
  2001-12-14 13:08 ` Borsenkow Andrej
  2001-12-14 15:36 ` Bart Schaefer
  0 siblings, 2 replies; 3+ messages in thread
From: Hannu Koivisto @ 2001-12-14 13:00 UTC (permalink / raw)
  To: Zsh Users' List

Greetings,

I have few other colon separated paths in addition to PATH and
MANPATH that need to be managed in a similar fashion.  In PATH's
and MANPATH's case I can avoid duplicates by saying "typeset -U
path manpath" because PATH and MANPATH are special in that they
mirror array parameters path and manpath, respectively.  I couldn't
find any way to establish similar mirroring for arbitrary
variables, though, so I need to get rid of duplicates manually.  I
thought about creating a temporary array, let's call it "foo",
declare its elements unique and then split elements of my colon
separated variables into it and join them back.  Unfortunately I
couldn't get splitting to work.  I tried...

BAR=foo:bar:baz
foo=(${(s:::)BAR}

...but s expansion flag couldn't split with plain ":" (for
understandable reasons).  I couldn't figure out any working way to
quote it either.  How should such splitting be done?  Or are there
alternative, easier ways of getting rid of duplicates in colon
separated paths?

-- 
Hannu
Please don't send copies of list mail


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-12-14 15:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-14 13:00 Effect of typeset -U for colon separated paths? Hannu Koivisto
2001-12-14 13:08 ` Borsenkow Andrej
2001-12-14 15:36 ` Bart Schaefer

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).