From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27052 invoked from network); 9 Oct 2007 16:01:18 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) 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.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 9 Oct 2007 16:01:18 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 54639 invoked from network); 9 Oct 2007 16:01:12 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 9 Oct 2007 16:01:12 -0000 Received: (qmail 11705 invoked by alias); 9 Oct 2007 16:01:05 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23932 Received: (qmail 11690 invoked from network); 9 Oct 2007 16:01:04 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 9 Oct 2007 16:01:04 -0000 Received: (qmail 53871 invoked from network); 9 Oct 2007 16:01:04 -0000 Received: from vinc17.pck.nerim.net (HELO prunille.vinc17.org) (213.41.242.187) by a.mx.sunsite.dk with SMTP; 9 Oct 2007 16:00:59 -0000 Received: by prunille.vinc17.org (Postfix, from userid 501) id D204219FBBD2; Tue, 9 Oct 2007 18:00:58 +0200 (CEST) Date: Tue, 9 Oct 2007 18:00:58 +0200 From: Vincent Lefevre To: zsh-workers@sunsite.dk Subject: Re: bug in patterns used for filename expansion (e.g. a[b/c]d) Message-ID: <20071009160058.GI22340@prunille.vinc17.org> Mail-Followup-To: zsh-workers@sunsite.dk References: <20071009124055.GH22340@prunille.vinc17.org> <200710091259.l99Cxifg025637@news01.csr.com> <20071009141239.GA10216@prunille.vinc17.org> <071009082413.ZM26445@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <071009082413.ZM26445@torch.brasslantern.com> X-Mailer-Info: http://www.vinc17.org/mutt/ User-Agent: Mutt/1.5.16-vl-r18739 (2007-09-28) On 2007-10-09 08:24:13 -0700, Bart Schaefer wrote: > That said, the thing zsh-as-ksh is most like is ksh88. I think that the manual should say that, because it seems that the provided AT&T ksh is generally ksh93 (e.g. under Debian and Mac OS X). > > } vin:~> ksh --version > } zsh 4.3.4 (i686-pc-linux-gnu) > } vin:~> ksh > } $ ls a[b/* > } ls: a[b/*: No such file or directory > } > } vin:~> ksh93 > } $ ls a[b/* > } > ksh93: syntax error: `[' unmatched > > This is exactly the difference between bash and ksh as mentioned on > the austin-group, is it not? No, Geoff Clare said in the austin-group is: $ ls a[b/* a[b/file in both cases. This is also what I obtain with AT&T ksh93 under Mac OS X. So, only zsh, when run as ksh, is different. Is this a bug in zsh or does ksh88 behave like that? (I don't have ksh88, so I can't test.) > } vin:~> ksh -c 'ls a[b/*' > } ls: a[b/*: No such file or directory > } vin:~> ksh93 -c 'ls a[b/*' > } ls: a[b/*[: No such file or directory > > Where'd that extra '[' come from? I'd say this is a ksh bug. Yes, this is strange and ksh93 under Mac OS X behaves differently, so I assume that this is a bug in Debian's ksh package. > > } vin:~> touch 'a[b/*' > } vin:~> ksh93 -c 'ls a[b/*' > } ls: a[b/*[: No such file or directory > } vin:~> ksh -c 'ls a[b/*' > } a[b/* > > Again modulo the extra-bracket bug, this is the bash v. ksh thing. No: vin:~> ll a\[b -rw-r--r-- 1 vlefevre vlefevre 0 2007-10-09 16:10:36 * -rw-r--r-- 1 vlefevre vlefevre 0 2007-10-09 16:25:17 *[ -rw-r--r-- 1 vlefevre vlefevre 0 2007-10-09 16:04:18 file vin:~> bash -c 'ls a[b/*' a[b/* a[b/*[ a[b/file and with ksh from Mac OS X (sh (AT&T Labs Research) 1993-12-28 p), I get the same behavior, while zsh gives: vin:~> ksh -c 'ls a[b/*' a[b/* -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)