From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20315 invoked from network); 17 Aug 1998 15:04:22 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 17 Aug 1998 15:04:22 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id KAA20833; Mon, 17 Aug 1998 10:43:33 -0400 (EDT) Resent-Date: Mon, 17 Aug 1998 10:43:26 -0400 (EDT) Message-Id: <199808171445.PAA24008@diamond.tao.co.uk> Subject: Re: Parameter Expansion questions To: dfavor@austin.ibm.com (David R. Favor) Date: Mon, 17 Aug 1998 15:45:33 +0100 (BST) From: "Zefram" Cc: zsh-users@math.gatech.edu In-Reply-To: <35D836E3.F7BEBC77@austin.ibm.com> from "David R. Favor" at Aug 17, 98 08:57:55 am X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"T5How2.0.e45.D64sr"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1721 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu David R. Favor wrote: >In zsh, I'm having a challenge deciphering the manual about parameter >expansion options. I've tried the following, without success. All fragments >set $IFS=: before expansion: > > export SH_WORD_SPLIT // explicit 'set SH_WORD_SPLIT' > splitpath=$* zsh doesn't perform field splitting on the RHS of scalar variable assignments. Try "echo $*" under equivalent circumstances. >I did figure out that this works: > > splitpath=${buf:gs/:/ /} That's doing a substitution, rather than field splitting. Since the effect you're asking for is actually a substitution, rather than field splitting (since you're just joining up the fields again anyway), this is logically the correct thing to do. OTOH, I suspect that you *really* want to be using an array parameter. $path is an array version of $PATH, so you don't even need to do the splitting manually in that case. -zefram