Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: globbing problem



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 <manfred.lotz@xxxxxxxx> 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




Messages sorted by: Reverse Date, Date, Thread, Author