From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11976 invoked from network); 23 Feb 2003 23:08:23 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 23 Feb 2003 23:08:23 -0000 Received: (qmail 15896 invoked by alias); 23 Feb 2003 23:08:14 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18277 Received: (qmail 15889 invoked from network); 23 Feb 2003 23:08:13 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 23 Feb 2003 23:08:13 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [63.107.91.101] by sunsite.dk (MessageWall 1.0.8) with SMTP; 23 Feb 2003 23:8:13 -0000 Received: from itasoftware.com (phl.internal.itasoftware.com [192.168.1.115]) by mta.internal.itasoftware.com (8.12.6/8.12.6) with ESMTP id h1NN8AxY016941; Sun, 23 Feb 2003 18:08:10 -0500 Received: (from greg@localhost) by itasoftware.com (8.11.6/8.8.7) id h1NN8Ak22756; Sun, 23 Feb 2003 18:08:10 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15961.21594.705429.113987@gargle.gargle.HOWL> Date: Sun, 23 Feb 2003 18:08:10 -0500 From: gak@klanderman.net (Greg Klanderman) To: zsh-workers@sunsite.dk (Zsh list) Subject: NOSHWORDSPLIT problem?? Reply-To: gak@klanderman.net X-Mailer: VM 7.00 under 21.4 (patch 6) "Common Lisp" XEmacs Lucid Hi, I've been trying to wean myself from using double quotes around everything since my understanding was that with SHWORDSPLIT unset this was no longer needed. However, there does seem to be a case when you still get screwed, and I'm wondering if that is intentional or a bug in zsh. You still run into trouble if you have a variable containing the empty string. First some preliminaries: phl% /bin/zsh-4.0.6 -f phl% phl% echo $ZSH_VERSION 4.0.6 phl% unsetopt shwordsplit phl% function count () { echo $# } phl% phl% w="foo" phl% x="bar baz" phl% y=" space-on-either-end " phl% z="" When $z is not enclosed in double quotes, the empty string does not make it into the array a: phl% a=( $w $x $y $z ) phl% echo $#a 3 phl% count $a[@] 3 phl% for v in $a[@] ; do echo "v= \"$v\"" ; done v= "foo" v= "bar baz" v= " space-on-either-end " If $z is enclosed in double quotes, the empty string does make it into the array a, but I further need to enclose expansions of the form $a[@] in double quotes to have it not be elided: phl% a=( $w $x $y "$z" ) phl% echo $#a 4 phl% count $a[@] 3 phl% for v in $a[@] ; do echo "v= \"$v\"" ; done v= "foo" v= "bar baz" v= " space-on-either-end " phl% for v in "$a[@]" ; do echo "v= \"$v\"" ; done v= "foo" v= "bar baz" v= " space-on-either-end " v= "" This seems pretty broken to me, because I still need to use all those silly double quotes that NOSHWORDSPLIT is supposed to avoid. thanks, Greg