From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25669 invoked from network); 14 Dec 2001 13:00:49 -0000 Received: from ns2.primenet.com.au (HELO primenet.com.au) (?KE8yDZOZDS34d2e3yKOKmOgAPSbZIRBz?@203.24.36.3) by ns1.primenet.com.au with SMTP; 14 Dec 2001 13:00:49 -0000 Received: (qmail 1291 invoked from network); 14 Dec 2001 13:00:47 -0000 Received: from sunsite.dk (130.225.247.90) by proxy.melb.primenet.com.au with SMTP; 14 Dec 2001 13:00:47 -0000 Received: (qmail 11320 invoked by alias); 14 Dec 2001 13:00:33 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4536 Received: (qmail 11303 invoked from network); 14 Dec 2001 13:00:31 -0000 To: Zsh Users' List Subject: Effect of typeset -U for colon separated paths? Mail-copies-to: nobody From: Hannu Koivisto Date: Fri, 14 Dec 2001 15:00:30 +0200 Message-ID: <87snaet0r5.fsf@lynx.ionific.com> User-Agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: Hannu Koivisto 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