From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14402 invoked by alias); 24 Oct 2011 15:00:05 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16541 Received: (qmail 7378 invoked from network); 24 Oct 2011 15:00:04 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 74.125.82.43 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=98s6ZOsBF+RI5vznRs7PG22tIVZCIxJwgGIqd/hlkEc=; b=TcdDEHY00B6rWq4XrEtkInv9PFK7J9jsVGYL/+OYa0ZgEAgDkh9Ajlnnl/R4EEfjCX EmJCwWG3JiNbpp9B9dqYTmdo4pJDeUYNbWKOAa/m/zt9v9DhzBnoJQxgz7L7jtf96v0U RJm4dH38cyVlnuZ6rWXHO7JAmwum/GFr/VUUg= MIME-Version: 1.0 In-Reply-To: References: From: =?UTF-8?B?SsOpcsOpbWllIFJvcXVldA==?= Date: Mon, 24 Oct 2011 16:59:43 +0200 Message-ID: Subject: Re: checking for file existence when I don't know the exact name To: Zsh Users Cc: TJ Luoma Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2011/10/24 TJ Luoma : > 2011/10/24 J=C3=A9r=C3=A9mie Roquet >> From the man, section =E2=80=9Cconditional expressions=E2=80=9D : >> >> =C2=A0=E2=80=9CFile generation is not =C2=A0performed on any form of arg= ument to >> conditions.=E2=80=9D > > This isn't file _generation_, is it? Or am I not understanding zsh's term= s? Err, it's file*name* generation, actually. In zsh's terms, filename generation refers to globbing. Peter, maybe we should fix the doc there? > I still don't fully understand why / when to use [[ ]] instead of [ ] Most of the time, I guess. [[ ]] is part of the syntax and has a number of advanced features while [ is just a command very similar to =E2=80=9Ctest=E2=80=9D and ] an argument to this command. Unless you want to keep your scripts portable accross different shells, of course. Best regards, --=20 J=C3=A9r=C3=A9mie diff --git a/Doc/Zsh/cond.yo b/Doc/Zsh/cond.yo index 489ee35..71971b4 100644 --- a/Doc/Zsh/cond.yo +++ b/Doc/Zsh/cond.yo @@ -184,7 +184,7 @@ enditem() Normal shell expansion is performed on the var(file), var(string) and var(pattern) arguments, but the result of each expansion is constrained to be a single word, similar to the effect of double quotes. -File generation is not performed on any form of argument to conditions. +Filename generation is not performed on any form of argument to conditions= . However, pattern metacharacters are active for the var(pattern) arguments; the patterns are the same as those used for filename generation, see ifzman(\