From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20232 invoked by alias); 6 Mar 2012 12:00:44 -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: 16845 Received: (qmail 29206 invoked from network); 6 Mar 2012 12:00:33 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.161.171 as permitted sender) Received-SPF: pass (google.com: domain of mikachu@gmail.com designates 10.60.14.101 as permitted sender) client-ip=10.60.14.101; Authentication-Results: mr.google.com; spf=pass (google.com: domain of mikachu@gmail.com designates 10.60.14.101 as permitted sender) smtp.mail=mikachu@gmail.com; dkim=pass header.i=mikachu@gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=qezA/eXCKKmSbUUamprpNAKGe1tWAATh/itlGKu4WHY=; b=sRFPYwMYoKEfbjk3Kp69WfgXsX9hDRqM/OdAoKheh7l+P2gz5tjWRQ+0eCjq3MVPkV 7K33rZ8UOyBfCbdv9peIEZOdfZZ/cxm6+tpEoRsbE8XpUJ8QA9Gtv22kh2Ni1bPxPb41 onkOQqNF0tXtYfmUfDB4qbq49AlN2AghszcVfnrzGtRKEpUbt0MfH4K3s6izBXhDjwHy HZtOkNa6gkdUOZuhygNOEUYP19nhhjAcPbH0UDRhQcnjuFLNcbzdnp4co3zNcDcg7fbZ Ys0vwEchX3psOOSwUHZtvZLk6nntWNc+X69YGSl9UOl4fIhc3vsrR7Sn+g2EFJ8oCBsG VYaw== MIME-Version: 1.0 In-Reply-To: <20120306114404.359e1c9d@pwslap01u.europe.root.pri> References: <4F52D510.6000002@sergio.spb.ru> <120303202448.ZM21278@torch.brasslantern.com> <4F555B0B.1050401@sergio.spb.ru> <120305220555.ZM27709@torch.brasslantern.com> <4F55EF85.3050809@sergio.spb.ru> <20120306113532.789859ca@pwslap01u.europe.root.pri> <20120306114404.359e1c9d@pwslap01u.europe.root.pri> Date: Tue, 6 Mar 2012 12:53:17 +0100 Message-ID: Subject: Re: [[ and [ From: Mikael Magnusson To: Peter Stephenson Cc: zsh-users@zsh.org Content-Type: text/plain; charset=UTF-8 On 6 March 2012 12:44, Peter Stephenson wrote: > On Tue, 6 Mar 2012 11:35:32 +0000 > Peter Stephenson wrote: >> However, >> >> [[ $foo -eq "" ]] >> >> does exactly what it looks like it does > > Sigh. Sort of. [ ... -eq ...] and [[ ... -eq ... ]] are numeric tests, > so if foo is a string of zeros it's not doing what it looks like. I > should have said > > [ $foo = "" ]] > > and > > [[ $foo = "" ]] > > or > > [[ $foo == "" ]] > > I don't know why it's that way round, it seems a bit illogical (which is > why Perl is the other way), but it always has been that way. Incidentally, this is probably the most confusing error message ever, % [ $foo == "" ] zsh: = not found -- Mikael Magnusson