zsh-users
 help / color / mirror / code / Atom feed
From: Hannu Koivisto <azure@iki.fi>
To: Zsh Users' List <zsh-users@sunsite.auc.dk>
Subject: Effect of typeset -U for colon separated paths?
Date: Fri, 14 Dec 2001 15:00:30 +0200	[thread overview]
Message-ID: <87snaet0r5.fsf@lynx.ionific.com> (raw)

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


             reply	other threads:[~2001-12-14 13:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-14 13:00 Hannu Koivisto [this message]
2001-12-14 13:08 ` Borsenkow Andrej
2001-12-14 15:36 ` Bart Schaefer

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=87snaet0r5.fsf@lynx.ionific.com \
    --to=azure@iki.fi \
    --cc=zsh-users@sunsite.auc.dk \
    /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).