From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4251 invoked from network); 30 Jun 2001 17:58:44 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 30 Jun 2001 17:58:44 -0000 Received: (qmail 26153 invoked by alias); 30 Jun 2001 17:57:50 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15190 Received: (qmail 26126 invoked from network); 30 Jun 2001 17:57:49 -0000 To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Subject: Re: bracket expressions and POSIX In-reply-to: "Clint Adams"'s message of "Fri, 29 Jun 2001 14:22:15 EDT." <20010629142215.A8431@dman.com> Date: Sat, 30 Jun 2001 20:00:34 +0100 From: Peter Stephenson Message-Id: <20010630190039.59EB714286@pwstephenson.fsnet.co.uk> Clint Adams wrote: > POSIX says that \ loses its special meaning within a bracket > expression for pattern matching and also that ! is the > ^ character in that context. > > So this strikes me as non-compliant: > > % emulate sh > % touch \\test abc > % echo [!a]* > zsh: event not found: a] We can't do much directly about this (i.e. with BANG_HISTORY), as Bart pointed out. > % echo [\!a]* > \test Ooh err. I don't like that one at all. > % echo [\]* > []* > % echo [\\]* > \test These are non-compliant, but it's actually useful being able to quote things in a range with a backslash, particularly square brackets, rather than rely on the rather tricky rules of positioning (anyone remember off the top of their head how to match both a `]' and a `-'?). I hope it will be possible to turn this into an option (part of SH_GLOB?) by un-nulling the backslashes. It's possible the extra test could make a noticeable effect on the speed of pattern compilation, but again I hope not. I haven't looked at the code. -- Peter Stephenson Work: pws@csr.com Web: http://www.pwstephenson.fsnet.co.uk