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

globbing problem



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