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

Effect of typeset -U for colon separated paths?


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


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

Please don't send copies of list mail

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