From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13195 invoked from network); 29 Jun 2004 16:34:10 -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 16:34:10 -0000 Received: (qmail 2521 invoked from network); 29 Jun 2004 17:44:44 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 29 Jun 2004 17:44:44 -0000 Received: (qmail 2396 invoked by alias); 29 Jun 2004 16:33:31 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7619 Received: (qmail 2386 invoked from network); 29 Jun 2004 16:33:30 -0000 Received: from odin.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.85) by sunsite.dk with SMTP; 29 Jun 2004 16:33:30 -0000 Received: (qmail 1319 invoked from network); 29 Jun 2004 17:44:13 -0000 Received: from madrid10.amenworld.com (62.193.203.32) by a.mx.sunsite.dk with SMTP; 29 Jun 2004 17:44:03 -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 i5TGXHv12391 for ; Tue, 29 Jun 2004 18:33:17 +0200 Received: from raul@pleyades.net by DervishD.pleyades.net with local (Exim MTA 2.05) id <1BfLYg-00016w-00>; Tue, 29 Jun 2004 18:34:10 +0200 Date: Tue, 29 Jun 2004 18:34:10 +0200 From: DervishD To: zsh-users@sunsite.dk Subject: Re: Suppressing "no matches found" Glob Message? Message-ID: <20040629163410.GD4236@DervishD> Mail-Followup-To: 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> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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=none autolearn=no version=2.63 X-Spam-Hits: 0.0 Hi Bart :) * Bart Schaefer dixit: > > In certain sense, what you want is impossible. If you issue the 'ls' > > command with parameters, it will list those parameters (if they exist), > > but if you don't give it params, it will list all files and dirs. You > > cannot have a way of 'ls' shutting its mouth up if the pattern doesn't > > match anything. > Well, no, but you can have zsh not call "ls" in the first place if the > pattern doesn't match anything. Of course, but I think is faster to use 'find' or even 'print' together with the stat module, instead of 'ls' and a monster command line. That expansion **/*, can lead to a huge command line as you point at the end of your message. > lspf() { > files=( **/*(.N) ) > if (( $#files )) > then > ls $files > else > print -u2 "Dude, where's my file?" > fi > } Nice :)))) > Of course, when I try that, I get "argument list too long: ls" but that's > a different issue. You can use xargs, of course, but then you can use 'find' in the first place. Raúl Núñez de Arenas Coronado -- Linux Registered User 88736 http://www.pleyades.net & http://raul.pleyades.net/