zsh-users
 help / color / mirror / code / Atom feed
From: Manfred Lotz <manfred.lotz@arcor.de>
To: zsh-users@zsh.org
Subject: globbing problem
Date: Sun, 3 Mar 2013 09:29:08 +0100	[thread overview]
Message-ID: <20130303092908.0562f2d1@arcor.com> (raw)

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



             reply	other threads:[~2013-03-03  8:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-03  8:29 Manfred Lotz [this message]
2013-03-08 14:58 ` Manfred Lotz
2013-03-08 15:36   ` Jérémie Roquet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130303092908.0562f2d1@arcor.com \
    --to=manfred.lotz@arcor.de \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).