zsh-users
 help / color / mirror / code / Atom feed
* globbing problem
@ 2013-03-03  8:29 Manfred Lotz
  2013-03-08 14:58 ` Manfred Lotz
  0 siblings, 1 reply; 3+ messages in thread
From: Manfred Lotz @ 2013-03-03  8:29 UTC (permalink / raw)
  To: zsh-users

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-03-08 16:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-03  8:29 globbing problem Manfred Lotz
2013-03-08 14:58 ` Manfred Lotz
2013-03-08 15:36   ` Jérémie Roquet

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).