From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2422 invoked by alias); 15 Dec 2012 19:34:38 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17478 Received: (qmail 2853 invoked from network); 15 Dec 2012 19:34:27 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <121215113422.ZM32237@torch.brasslantern.com> Date: Sat, 15 Dec 2012 11:34:22 -0800 In-reply-to: <20121215183339.5e22fc1c@pws-pc.ntlworld.com> Comments: In reply to Peter Stephenson "Re: Correct way to set environment" (Dec 15, 6:33pm) References: <20121215183339.5e22fc1c@pws-pc.ntlworld.com> <121215111934.ZM32088@torch.brasslantern.com> In-reply-to: <121215111934.ZM32088@torch.brasslantern.com> Comments: In reply to Bart Schaefer "Re: Correct way to set environment" (Dec 15, 11:19am) X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: Correct way to set environment MIME-version: 1.0 Content-type: text/plain; charset=us-ascii 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.)