From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14760 invoked by alias); 8 Mar 2013 15:08:34 -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: 17682 Received: (qmail 3661 invoked from network); 8 Mar 2013 15:08:30 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,T_TO_NO_BRKTS_FREEMAIL autolearn=ham version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at m.gmane.org designates 80.91.229.3 as permitted sender) X-Injected-Via-Gmane: http://gmane.org/ To: zsh-users@zsh.org From: Manfred Lotz Subject: Re: globbing problem Date: Fri, 8 Mar 2013 15:58:32 +0100 Message-ID: <20130308155832.4091cb20@arcor.com> References: <20130303092908.0562f2d1@arcor.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p4fff3bb7.dip.t-dialin.net X-Newsreader: Claws Mail 3.8.0 (GTK+ 2.24.10; x86_64-pc-linux-gnu) In the meantime I saw that my question which I posted on zsh.user was answered on zsh-workers. Bart, your suggestion worked like a charm. Thanks for your help. In the meantime I subscribed to zsh-workers which seems to be the best to do. -- Thanks again, Manfred On Sun, 3 Mar 2013 09:29:08 +0100 Manfred Lotz wrote: > Hi all, > I like to define a function to display directories only. > > I like to call it with or without pattern like in the following > examples: > > > # show all directories > lsd > > # show all directories starting with letter m > lsd m* > > > # show all directories starting with letter m or letter h > lsd m* h* > > > I tried all sort of things and ended with the following which > unfortunately doesn't work either: > > > function lsd() { > if (( $# > 0 )); then > ls -d "$*"(/) > else > ls -d *(/) > fi > } > > > alias lsd='noglob lsd' > > > lsd without parms works fine but for instance this > > $ lsd m* > ls: cannot access m*(/): No such file or directory > > doesn't work. > > > What is my mistake? > > > -- Manfred