Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Maildir empty?
- X-seq: zsh-users 7686
- From: Klaus Wacker <wacker@xxxxxxxxxxxxxxxxxxxxxx>
- To: ZSH User List <zsh-users@xxxxxxxxxx>
- Subject: Re: Maildir empty?
- Date: Mon, 12 Jul 2004 16:09:01 +0200
- In-reply-to: <20040712132221.GA818@DervishD>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20040712073705.GN2860@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <690.1089625465@xxxxxxxxxxxxxxxxxxxxx> <20040712124144.GO2860@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <20040712132221.GA818@DervishD>
- Reply-to: wacker@xxxxxxxxxxxxxxxxxxxxxx
On Mon, Jul 12, 2004 at 03:22:21PM +0200, DervishD wrote:
> Hi Klaus and Oliver :)
>
> * Klaus Wacker <wacker@xxxxxxxxxxxxxxxxxxxxxx> dixit:
> > > Does this do what you want:
> > > if [ -z $i/*/*([1]) ]
> > > You need to use the single brackets so that the $i/*/* is treated as a
> > > filename expansion.
>
> Why are single brackets needed here instead of [[ -z ... ]]? Why
> with single brackets the $i/*/* construction is treated as a filename
> expansion? Is it not using double brackets?
>
I can only give a partial answer. `[' is treated like any other
command, so its arguments are subject to filename expansion. The
closing `]' is basically ignored. Zsh has `[' as a built-in, but there
is also /usr/bin/[. `[[...]]' is a real shell construct with its own
syntax and rules. Don't ask me what exactly the rules are, but
essentially they are geared more towards pattern matching than file
globbing, if I remember correctly.
--
Klaus Wacker wacker@xxxxxxxxxxxxxxxxxxxxxx
Experimentelle Physik V http://www.physik.uni-dortmund.de/~wacker
Universitaet Dortmund Tel.: +49 231 755 3587
D-44221 Dortmund Fax: +49 231 755 4547
Messages sorted by:
Reverse Date,
Date,
Thread,
Author