From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18956 invoked from network); 28 Feb 2006 23:41:30 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 28 Feb 2006 23:41:30 -0000 Received: (qmail 82547 invoked from network); 28 Feb 2006 23:41:22 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 28 Feb 2006 23:41:22 -0000 Received: (qmail 25285 invoked by alias); 28 Feb 2006 23:41:15 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9968 Received: (qmail 25275 invoked from network); 28 Feb 2006 23:41:15 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 28 Feb 2006 23:41:15 -0000 Received: (qmail 81448 invoked from network); 28 Feb 2006 23:41:15 -0000 Received: from vinc17.net8.nerim.net (HELO prunille.vinc17.org) (62.212.121.106) by a.mx.sunsite.dk with SMTP; 28 Feb 2006 23:41:13 -0000 Received: by prunille.vinc17.org (Postfix, from userid 501) id C08F46FE832; Wed, 1 Mar 2006 00:41:10 +0100 (CET) Date: Wed, 1 Mar 2006 00:41:10 +0100 From: Vincent Lefevre To: zsh-users@sunsite.dk Subject: Re: alias limg='ls *.{jpg,gif}(.N)' Message-ID: <20060228234110.GD25687@prunille.vinc17.org> Mail-Followup-To: zsh-users@sunsite.dk References: <20060228181747.GB18839@namib.cs.utk.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20060228181747.GB18839@namib.cs.utk.edu> X-Mailer-Info: http://www.vinc17.org/mutt/ User-Agent: Mutt/1.5.11-vl-20060221 On 2006-02-28 13:17:47 -0500, Chris Johnson wrote: > zzapper sent me the following 0.2K: > > I was proud of my little alias > > > > alias limg='ls *.{jpg,gif}(.N)' > > > > But it has a teeny-weeny fault; if no image is found it lists everything > > There was some discussion on this in 2004, in which print was suggested > as a replacement to ls. Try: > > http://www.zsh.org/mla/users/2004/msg00621.html But ls would be better if you want the possibility to add options: limg() { ls "$@" *.{jpg,gif}(.N) } -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / SPACES project at LORIA