From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2488 invoked from network); 29 Mar 2004 00:53:27 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 29 Mar 2004 00:53:27 -0000 Received: (qmail 22492 invoked by alias); 29 Mar 2004 00:53:11 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7287 Received: (qmail 22434 invoked from network); 29 Mar 2004 00:53:11 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 29 Mar 2004 00:53:11 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [130.225.247.86] by sunsite.dk (MessageWall 1.0.8) with SMTP; 29 Mar 2004 0:53:11 -0000 Received: (qmail 17536 invoked from network); 29 Mar 2004 00:53:10 -0000 Received: from wbar3.sjo1-4-11-009-147.sjo1.dsl-verizon.net (HELO candle.brasslantern.com) (4.11.9.147) by a.mx.sunsite.dk with SMTP; 29 Mar 2004 00:53:08 -0000 Received: (from schaefer@localhost) by candle.brasslantern.com (8.11.6/8.11.6) id i2T0r6R26498 for zsh-users@sunsite.dk; Sun, 28 Mar 2004 16:53:06 -0800 X-Authentication-Warning: candle.brasslantern.com: schaefer set sender to schaefer@closedmail.com using -f From: Bart Schaefer Message-Id: <1040329005306.ZM26497@candle.brasslantern.com> Date: Mon, 29 Mar 2004 00:53:06 +0000 In-Reply-To: <20040328220419.21291.qmail@webmail-2-6.mesa1.secureserver.net> Comments: In reply to jason@jnj.org "IFS, set, and positional parameters not doing what I expect" (Mar 28, 3:04pm) References: <20040328220419.21291.qmail@webmail-2-6.mesa1.secureserver.net> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-users@sunsite.dk Subject: Re: IFS, set, and positional parameters not doing what I expect MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: **** X-Spam-Status: No, hits=4.7 required=6.0 tests=RCVD_IN_DYNABLOCK, RCVD_IN_NJABL,RCVD_IN_NJABL_DIALUP,RCVD_IN_SORBS autolearn=no version=2.63 X-Spam-Hits: 4.7 On Mar 28, 3:04pm, jason@jnj.org wrote: } } f="a:b:c" } OFS=$IFS; IFS=: ; set -- $f ; IFS=$OFS } } which sets $1=a, $2=b, $3=c. This requires either set -- ${=f} Or that you have `setopt sh_word_split'. } In zsh, this sets $1=a:b:c. I've tried mucking around with } the word splitting options to no avail. Works For Me (tm): schaefer<501> setopt shwordsplit schaefer<502> f="a:b:c" schaefer<503> OFS=$IFS; IFS=: ; set -- $f ; IFS=$OFS schaefer<504> echo $1 a schaefer<505> echo $2 b schaefer<506> echo $3 c