From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17134 invoked by alias); 14 Jan 2017 18:23:09 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 22379 Received: (qmail 11352 invoked from network); 14 Jan 2017 18:23:09 -0000 X-Qmail-Scanner-Diagnostics: from mail.cs.uni-magdeburg.de by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(141.44.21.48):SA:0(-3.2/5.0):. Processed in 0.862001 secs); 14 Jan 2017 18:23:09 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=RP_MATCHES_RCVD autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: jel+zsh@cs.uni-magdeburg.de X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at cs.uni-magdeburg.de does not designate permitted sender hosts) X-Authentication-Warning: trex.cs.ovgu.de: elkner set sender to jel+zsh@cs.uni-magdeburg.de using -f Date: Sat, 14 Jan 2017 19:23:03 +0100 From: Jens Elkner To: zsh-users@zsh.org Subject: Re: whence question Message-ID: <20170114182303.GB12641@trex.cs.ovgu.de> References: <652bcc3f-7365-2e52-d39c-8576278606bc@eastlink.ca> <7b890e89-d01b-ab5c-32bf-b75bfa8d945c__41234.9168131643$1484374276$gmane$org@eastlink.ca> <20170114064807.GA31410@fujitsu.shahaf.local2> <20170114174622.GA12641@trex.cs.ovgu.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Milter: milter4j - Mail Filter for Java 1.1.4 (b767) X-Milter: ClamAV 0.98.1-jel on mail - Status: Clean X-RcptTo: zsh-users@zsh.org On Sat, Jan 14, 2017 at 09:59:05AM -0800, Bart Schaefer wrote: > On Sat, 14 Jan 2017, Jens Elkner wrote: > > > especially in 'for' like statements, dropping it silently makes sense > > (is expected). To accomplish this in an easy way, ksh93 allows one to > > prefix the pattern with '~(N)' , e.g.: > > > > Would be nice, if zsh could do the same (and enhance compatibility) ... > > Zsh has had this for many years, except you suffix the pattern rather > than prefix it and there's no extra "~": > > for F in *.c(N) ; do ls $F ; done Ah ok - good to know, thanx. > Zsh can't readily adopt ksh's exact syntax here because ~(N)*.c is taken > to be a pattern grouping, e.g. ~(N|M)*.c would match home directories > for user names beginning with N or M and ending in .c. Well, it is a special case, which needs some snooping, but does not really collide with your example: as soon as something different than 'N' appears inside the parens, it can be handled as usual, otherwise add the corresponding flag to the pattern (or wherever it is needed in the state machine). If one really wants to have something from the user[s] N* only, one can/should simply omit the parens - IMHO no big deal. Have fun, jel. -- Otto-von-Guericke University http://www.cs.uni-magdeburg.de/ Department of Computer Science Geb. 29 R 027, Universitaetsplatz 2 39106 Magdeburg, Germany Tel: +49 391 67 52768