From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18192 invoked by alias); 24 Jun 2011 04:13:05 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 29505 Received: (qmail 23109 invoked from network); 24 Jun 2011 04:13:02 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <110623211249.ZM11110@torch.brasslantern.com> Date: Thu, 23 Jun 2011 21:12:47 -0700 In-reply-to: Comments: In reply to Mikael Magnusson "(#cN,M) error, %? doesn't glob" (Jun 24, 4:00am) References: X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh workers Subject: Re: (#cN,M) error, %? doesn't glob MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Jun 24, 4:00am, Mikael Magnusson wrote: } } The flag tt(LPAR()#c)var(N)tt(,)var(M)tt(RPAR()) can be used anywhere } +that the tt(#) or tt(##) operators can be used except in the expressions } +`tt((*/)#)' and `tt((*/)##)' That's not quite right. [[ bar/foo == (*/)(#c1,2)foo ]] does not produce a bad pattern error. It's only in glob context where "/" has special significance that (*/)# is also a special case. } While looking at Src/glob.c I also noticed that ? is ignored for } globbing if it is preceded by a % at the start of a string, is that } documented anywhere? Etc/BUGS -- second to last entry. } I sort of feel like an explicit option for this would be a bit awkward. See one proposed fix in Etc/BUGS ... I believe this behavior is actually "inherited" from csh -- one original design goal of zsh was to import as much as possible of csh's interactive behavior into the Bourne shell's syntax structure. Tcsh seems to have solved it by making builtins that manipulate jobs into special keywords that alter the parse of what comes after, much in the way that ksh applies assignment context to arguments that follow the typeset and local builtins: $ echo %?foo echo: No match. $ fg %?foo fg: No job matches pattern. --