From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21350 invoked by alias); 3 Mar 2013 08:59:17 -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: 17661 Received: (qmail 21438 invoked from network); 3 Mar 2013 08:59:05 -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: globbing problem Date: Sun, 3 Mar 2013 09:29:08 +0100 Message-ID: <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: p4fff30ce.dip.t-dialin.net X-Newsreader: Claws Mail 3.8.0 (GTK+ 2.24.10; x86_64-pc-linux-gnu) 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