From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10564 invoked from network); 29 Jun 2004 09:57:27 -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:57:27 -0000 Received: (qmail 7890 invoked from network); 29 Jun 2004 11:07:49 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 29 Jun 2004 11:07:49 -0000 Received: (qmail 9535 invoked by alias); 29 Jun 2004 09:56:47 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7612 Received: (qmail 9525 invoked from network); 29 Jun 2004 09:56:47 -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:56:47 -0000 Received: (qmail 6865 invoked from network); 29 Jun 2004 11:07:18 -0000 Received: from main.gmane.org (80.91.224.249) by a.mx.sunsite.dk with SMTP; 29 Jun 2004 11:07:08 -0000 Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1BfFLw-0007kT-00 for ; Tue, 29 Jun 2004 11:56:36 +0200 Received: from hippo.asfast.com ([216.182.10.250]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 29 Jun 2004 11:56:36 +0200 Received: from ljz by hippo.asfast.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 29 Jun 2004 11:56:36 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-users@sunsite.dk From: Lloyd Zusman Subject: Re: Suppressing "no matches found" Glob Message? Date: Tue, 29 Jun 2004 05:56:12 -0400 Message-ID: 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> <20040629085235.GC3953@DervishD> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: hippo.asfast.com User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.2 (gnu/linux) Cancel-Lock: sha1:QTiX6ogeyfPBmhGP9PHemNONGBY= Sender: news 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=none autolearn=no version=2.63 X-Spam-Hits: 0.0 ”Hola Raśl! DervishD writes: > [ ... ] > > * Aaron Davies dixit: >> 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 print nothing _except_ a possible error message! How about this? function special_ls() { emulate -L zsh setopt NOMATCH { ls **/*(.) } 2>/dev/null return 0 } -- Lloyd Zusman ljz@asfast.com God bless you.