Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: globbing problem
- X-seq: zsh-workers 31100
- From: Christian Neukirchen <chneukirchen@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: globbing problem
- Date: Sun, 03 Mar 2013 15:40:57 +0100
- In-reply-to: <20130303092908.0562f2d1__42920.4312772073$1362301372$gmane$org@arcor.com> (Manfred Lotz's message of "Sun, 3 Mar 2013 09:29:08 +0100")
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20130303092908.0562f2d1__42920.4312772073$1362301372$gmane$org@arcor.com>
- Sender: chris@juno
Manfred Lotz <manfred.lotz@xxxxxxxx> writes:
> function lsd() {
> if (( $# > 0 )); then
> ls -d "$*"(/)
> else
> ls -d *(/)
> fi
> }
>
>
> alias lsd='noglob lsd'
> $ lsd m*
> ls: cannot access m*(/): No such file or directory
>
> doesn't work.
>
> What is my mistake?
You need to force globbing. Try this:
lsd() { local -a pat; pat=(${^*:-*}'(/N)'); ls -d ${~pat} }
(How to do it without a temporary variable?)
--
Christian Neukirchen <chneukirchen@xxxxxxxxx> http://chneukirchen.org
Messages sorted by:
Reverse Date,
Date,
Thread,
Author