From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23532 invoked by alias); 7 Mar 2012 08:22:39 -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: 16852 Received: (qmail 14466 invoked from network); 7 Mar 2012 08:22:36 -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=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at math.technion.ac.il does not designate permitted sender hosts) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAI4XV0+ERHMG/2dsb2JhbABDtQ2BB4F9AQEFOj8OAgsYLhQHETETiAe6DwSQCWMElT4BkBaCZQ X-IronPort-AV: E=Sophos;i="4.73,545,1325455200"; d="scan'208";a="82089892" Date: Wed, 7 Mar 2012 10:12:11 +0200 From: Nadav Har'El To: sergio Cc: zsh-users@zsh.org Subject: Re: [[ and [ Message-ID: <20120307081211.GB15125@fermat.math.technion.ac.il> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F55EF85.3050809@sergio.spb.ru> User-Agent: Mutt/1.5.20 (2009-12-10) On Tue, Mar 06, 2012, sergio wrote about "Re: [[ and [": > On 03/06/2012 10:05 AM, Bart Schaefer wrote: > > What was the reason to implement [[ ]]? What advantages it gives? As > I see [[ ]] and [ ] provides same features. In the original Unix, "[" was not a shell builtin - it was a normal program, /bin/[, normally a hard link to /bin/test. As such, you needed to follow ordinary (and annoying) quoting rules for its parameters. When ksh (and later zsh and bash) implemented '[' as a builtin, it retained its exact old behavior for backward compatibility, this should NOT and instead invented a new syntax, the [[, for an improved version, with less need for quoting and new tests, including for example the "<" operator for text dictionary-order (on why this deals with text and not numbers, see my separate reply). -- Nadav Har'El | Wednesday, Mar 7 2012, nyh@math.technion.ac.il |----------------------------------------- Phone +972-523-790466, ICQ 13349191 |Linux: Because a PC is a terrible thing http://nadav.harel.org.il |to waste.