From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15504 invoked from network); 24 Jul 2005 09:42:56 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 24 Jul 2005 09:42:56 -0000 Received: (qmail 33127 invoked from network); 24 Jul 2005 09:42:50 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 24 Jul 2005 09:42:50 -0000 Received: (qmail 3555 invoked by alias); 24 Jul 2005 09:42:43 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9144 Received: (qmail 3546 invoked from network); 24 Jul 2005 09:42:42 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 24 Jul 2005 09:42:42 -0000 Received: (qmail 31975 invoked from network); 24 Jul 2005 09:42:42 -0000 Received: from vms046pub.verizon.net (206.46.252.46) by a.mx.sunsite.dk with SMTP; 24 Jul 2005 09:42:38 -0000 Received: from candle.brasslantern.com ([71.116.88.149]) by vms046.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0IK4004I1LN1I9J6@vms046.mailsrvcs.net> for zsh-users@sunsite.dk; Sun, 24 Jul 2005 04:42:38 -0500 (CDT) Received: from candle.brasslantern.com (IDENT:schaefer@localhost [127.0.0.1]) by candle.brasslantern.com (8.12.11/8.12.11) with ESMTP id j6O9gaZ1020747 for ; Sun, 24 Jul 2005 02:42:36 -0700 Received: (from schaefer@localhost) by candle.brasslantern.com (8.12.11/8.12.11/Submit) id j6O9gaTB020746 for zsh-users@sunsite.dk; Sun, 24 Jul 2005 02:42:36 -0700 Date: Sun, 24 Jul 2005 09:42:36 +0000 From: Bart Schaefer Subject: Re: twisted braces In-reply-to: <70e6e1decknsmiktk8l114194omchju2lc@4ax.com> To: zsh-users@sunsite.dk Message-id: <1050724094236.ZM20745@candle.brasslantern.com> MIME-version: 1.0 X-Mailer: Z-Mail (5.0.0 30July97) Content-type: text/plain; charset=us-ascii References: <70e6e1decknsmiktk8l114194omchju2lc@4ax.com> Comments: In reply to zzapper "twisted braces" (Jul 24, 7:46am) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.4 On Jul 24, 7:46am, zzapper wrote: } } I got into a twist recently with conditional braces ie if (( [[ and [ (( ... )) is not for conditional expressions, it's for arithmetic. It happens that the results of arithmetic can be tested with "if" et al., but that's not its primary purpose. } My problems were solved by using the single [. That probably means you needed filename generation or another operation that occurs for ordinary commands. } I read in the doc that (( was no longer recommended? Where? Quote, please. If true, that should be repaired. } From my Bash days I seem to think [[ was required for substring matching? [[ ... ]] is a true syntactic construct whereas [ ... ] is merely a command (a synonym for "test ..."). Therefore the shell applies very different rules inside [[ ... ]], one of which is that comparisons use pattern matching and another of which is that filename generation is not performed (so that glob patterns can be used for comparisons). } Comments? RTFM? In particular, the sections "Shell Grammar" and "Conditional Expressions".