From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29760 invoked from network); 29 Jun 2004 09:29:02 -0000 Received: from odin.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.85) by ns1.primenet.com.au with SMTP; 29 Jun 2004 09:29:02 -0000 Received: (qmail 25854 invoked from network); 29 Jun 2004 10:39:11 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 29 Jun 2004 10:39:11 -0000 Received: (qmail 4749 invoked by alias); 29 Jun 2004 09:28:14 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7611 Received: (qmail 4738 invoked from network); 29 Jun 2004 09:28:13 -0000 Received: from odin.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.85) by sunsite.dk with SMTP; 29 Jun 2004 09:28:13 -0000 Received: (qmail 24876 invoked from network); 29 Jun 2004 10:38:44 -0000 Received: from madrid10.amenworld.com (62.193.203.32) by a.mx.sunsite.dk with SMTP; 29 Jun 2004 10:38:33 -0000 Received: from DervishD.pleyades.net (212.Red-80-35-44.pooles.rima-tde.net [80.35.44.212]) by madrid10.amenworld.com (8.10.2/8.10.2) with ESMTP id i5T9Rt314168; Tue, 29 Jun 2004 11:27:56 +0200 Received: from raul@pleyades.net by DervishD.pleyades.net with local (Exim MTA 2.05) id <1BfELz-00011y-00>; Tue, 29 Jun 2004 10:52:35 +0200 Date: Tue, 29 Jun 2004 10:52:35 +0200 From: DervishD To: Aaron Davies , t@madrid10.amenworld.com Cc: zsh-users@sunsite.dk Subject: Re: Suppressing "no matches found" Glob Message? Message-ID: <20040629085235.GC3953@DervishD> Mail-Followup-To: Aaron Davies , t, zsh-users@sunsite.dk References: <2A3E94EA-C7E3-11D8-9C37-000502631FBD@columbia.edu> <20040627104222.GA237@DervishD> <6D3CE77E-C88C-11D8-A1EE-000A95EDC31A@louisville.edu> <20040628085300.GA1443@DervishD> <04955BBD-C956-11D8-ADCC-000A95EDC31A@louisville.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <04955BBD-C956-11D8-ADCC-000A95EDC31A@louisville.edu> User-Agent: Mutt/1.4.2.1i Organization: Pleyades X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=BAYES_50 autolearn=no version=2.63 X-Spam-Hits: 0.0 Hi Aaron :) * Aaron Davies dixit: > >Don't know, but you don't want NOMATCH set: it *prints* an error > >if a match is not found. If you unset it, what you are going to have > >is the pattern as-is, so 'ls' will complain saying that '**/*(.)' > >doesn't exist. > That wouldn't be so bad, actually; I could redirect that error to > /dev/null. So, does anyone know how to set that option in a pattern? I don't know. I've took a look at the manual and I haven't found anything about it. Anyway, if you are using such pattern you're bound to zsh, so, why not using 'print' instead of 'ls'? Using the 'stat' module of zsh will give you all information 'ls' gives. Otherwise, your solution of redirecting the error is good. You just need a shell function in order to set the NOMATCH option, something like (I'm writing on the fly, so it's untested): function special_ls() { emulate -L zsh setopt NOMATCH ls **/*(.) >& /dev/null return 0 } That will do. Raúl Núñez de Arenas Coronado -- Linux Registered User 88736 http://www.pleyades.net & http://raul.pleyades.net/