From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1163 invoked from network); 13 Mar 2004 19:00:04 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 13 Mar 2004 19:00:04 -0000 Received: (qmail 13163 invoked by alias); 13 Mar 2004 18:59:43 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7171 Received: (qmail 13151 invoked from network); 13 Mar 2004 18:59:42 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 13 Mar 2004 18:59:42 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [193.109.254.211] by sunsite.dk (MessageWall 1.0.8) with SMTP; 13 Mar 2004 18:59:42 -0000 X-VirusChecked: Checked X-Env-Sender: okiddle@yahoo.co.uk X-Msg-Ref: server-2.tower-36.messagelabs.com!1079204381!4624491 X-StarScan-Version: 5.2.5; banners=-,-,- X-Originating-IP: [158.234.9.163] Received: (qmail 22143 invoked from network); 13 Mar 2004 18:59:41 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-2.tower-36.messagelabs.com with SMTP; 13 Mar 2004 18:59:41 -0000 Received: from trentino.logica.co.uk ([158.234.142.61]) by iris.logica.co.uk (8.12.3/8.12.3/Debian -4) with ESMTP id i2DIxfCk026374; Sat, 13 Mar 2004 18:59:41 GMT Received: from trentino.logica.co.uk (localhost [127.0.0.1]) by trentino.logica.co.uk (Postfix) with ESMTP id F0CFB79721C1; Sat, 13 Mar 2004 19:58:56 +0100 (CET) Cc: zsh-users@sunsite.dk X-VirusChecked: Checked X-StarScan-Version: 5.0.7; banners=.,-,- In-reply-to: <1iqtnm45dkqid.dlg@thorstenkampe.de> From: Oliver Kiddle References: <1mm7og67rpkdy.dlg@thorstenkampe.de> <1040312105556.ZM22295@candle.brasslantern.com> <16tfmamy8a3c9.dlg@thorstenkampe.de> <1040313062454.ZM28736@candle.brasslantern.com> <1iqtnm45dkqid.dlg@thorstenkampe.de> To: Thorsten Kampe Subject: Re: Justifying text output Date: Sat, 13 Mar 2004 19:58:56 +0100 Message-ID: <3306.1079204336@trentino.logica.co.uk> Thorsten Kampe wrote: > I figured it out: "setopt shwordsplit" made the "extra spaces" and > "setopt rcexpandparam" made the multiple "[ ok ]". Please advise if > setting them makes sense - meaning making the life of a zsh non-expert > easier or more difficult. Most zsh experts probably set rcexpandparam but not shwordsplit. Setting shwordsplit makes zsh behave more like other Bourne type shells. Variables containing spaces are split into separate words when you expand the variable. Unless you're particularly used to it working this way, you'll probably find that leaving it unset will make life easier. If you want something to be split at spaces, it is generally better to use an array. rcexpandparam on the other hand tends to make life easier. To see what it does, try this: % a=(a b c) % echo 1${a}2 1a b c2 % setopt rcexpandparam % echo 1${a}2 1a2 1b2 1c2 Given that you seem to be writing a function or script here, you might want to consider adding: emulate -L zsh to the top of it. That resets all the options to sane values locally for the function. That way you don't risk breaking your script if you change your option settings later. Oliver