Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
globbing problem
- X-seq: zsh-users 17661
- From: Manfred Lotz <manfred.lotz@xxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: globbing problem
- Date: Sun, 3 Mar 2013 09:29:08 +0100
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author