From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27901 invoked from network); 1 Oct 2008 13:02:45 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 1 Oct 2008 13:02:45 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 10132 invoked from network); 1 Oct 2008 13:02:37 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 1 Oct 2008 13:02:37 -0000 Received: (qmail 23452 invoked by alias); 1 Oct 2008 13:02:28 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25792 Received: (qmail 23432 invoked from network); 1 Oct 2008 13:02:26 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 1 Oct 2008 13:02:26 -0000 Received: from cluster-g.mailcontrol.com (cluster-g.mailcontrol.com [208.87.233.190]) by bifrost.dotsrc.org (Postfix) with ESMTPS id 013558030847 for ; Wed, 1 Oct 2008 15:02:21 +0200 (CEST) Received: from cameurexb01.EUROPE.ROOT.PRI ([193.128.72.68]) by rly08g.srv.mailcontrol.com (MailControl) with ESMTP id m91D1tDo003843 for ; Wed, 1 Oct 2008 14:02:11 +0100 Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Wed, 1 Oct 2008 14:02:03 +0100 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.14.2/8.13.4) with ESMTP id m91D23oC000576 for ; Wed, 1 Oct 2008 14:02:03 +0100 Received: from csr.com (pws@localhost) by news01.csr.com (8.14.2/8.14.2/Submit) with ESMTP id m91D22VL000572 for ; Wed, 1 Oct 2008 14:02:03 +0100 X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Shell argument splitting behaviour X-Mailer: MH-E 8.0.3; nmh 1.3; GNU Emacs 22.1.1 Date: Wed, 01 Oct 2008 14:02:02 +0100 Message-ID: <571.1222866122@csr.com> From: Peter Stephenson X-OriginalArrivalTime: 01 Oct 2008 13:02:03.0815 (UTC) FILETIME=[E66C3370:01C923C5] X-Scanned-By: MailControl A-08-50-15 (www.mailcontrol.com) on 10.71.0.118 X-Virus-Scanned: ClamAV 0.92.1/8366/Wed Oct 1 12:44:34 2008 on bifrost X-Virus-Status: Clean I disovered this inconvenience in the parameter splitting flag (z) which splits words in a similar way to how command line arguments are handled. foo="(one) (two) (three)" print -l ${(z)foo} prints ( one ) (two) (three) That's because the command word in the line is treated differently; in this case, it looks like the start of a subshell. I wasn't expecting it when splitting a string, because it's just an arbitrary set of words, and my first reaction was to change it (which is easy enough) but I suppose you can think of it as a feature. The same feature occurs when the line editor splits arguments: in insert-last-word and copy-prev-shell-word. In those cases the current behaviour is right, although it'll only rarely make a difference. I thought I'd mention it in case anyone else had any reactions. What I was trying to do was use this to get lisp-like lists of arguments (since after the first word parentheses have to be balanced), but I can get that to work just by putting a dummy word in front, so it's actually not a major concern. -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070