zsh-users
 help / color / mirror / code / Atom feed
From: Klaus Wacker <wacker@physik.uni-dortmund.de>
To: ZSH User List <zsh-users@sunsite.dk>
Subject: Re: Maildir empty?
Date: Mon, 12 Jul 2004 16:09:01 +0200	[thread overview]
Message-ID: <20040712140900.GP2860@born.physik.uni-dortmund.de> (raw)
In-Reply-To: <20040712132221.GA818@DervishD>

On Mon, Jul 12, 2004 at 03:22:21PM +0200, DervishD wrote:
>     Hi Klaus and Oliver :)
> 
>  * Klaus Wacker <wacker@physik.uni-dortmund.de> 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@Physik.Uni-Dortmund.DE
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


  reply	other threads:[~2004-07-12 14:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-12  7:37 Klaus Wacker
2004-07-12  9:43 ` DervishD
2004-07-12  9:44 ` Oliver Kiddle
2004-07-12 12:41   ` Klaus Wacker
2004-07-12 13:22     ` DervishD
2004-07-12 14:09       ` Klaus Wacker [this message]
2004-07-12 14:33         ` DervishD
2004-07-12 18:04           ` Peter Whaite
2004-07-13 18:28             ` Dan Nelson
2004-07-12 10:00 ` Peter Stephenson
2004-07-12 14:17   ` Klaus Wacker
2004-07-12 14:44     ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040712140900.GP2860@born.physik.uni-dortmund.de \
    --to=wacker@physik.uni-dortmund.de \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).