From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20314 invoked from network); 3 Sep 2005 03:53:31 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 3 Sep 2005 03:53:31 -0000 Received: (qmail 84063 invoked from network); 3 Sep 2005 03:53:25 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 3 Sep 2005 03:53:25 -0000 Received: (qmail 11532 invoked by alias); 3 Sep 2005 03:53:16 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9376 Received: (qmail 11514 invoked from network); 3 Sep 2005 03:53:15 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 3 Sep 2005 03:53:15 -0000 Received: (qmail 82928 invoked from network); 3 Sep 2005 03:53:15 -0000 Received: from vms046pub.verizon.net (206.46.252.46) by a.mx.sunsite.dk with SMTP; 3 Sep 2005 03:53:11 -0000 Received: from candle.brasslantern.com ([71.116.79.190]) by vms046.mailsrvcs.net (Sun Java System Messaging Server 6.2-2.05 (built Apr 28 2005)) with ESMTPA id <0IM8009EK2SLWQ6B@vms046.mailsrvcs.net> for zsh-users@sunsite.dk; Fri, 02 Sep 2005 22:53:10 -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 j833r9T6023000 for ; Fri, 02 Sep 2005 20:53:09 -0700 Received: (from schaefer@localhost) by candle.brasslantern.com (8.12.11/8.12.11/Submit) id j833r8Z3022999 for zsh-users@sunsite.dk; Fri, 02 Sep 2005 20:53:08 -0700 Date: Sat, 03 Sep 2005 03:53:08 +0000 From: Bart Schaefer Subject: Re: Bad math expression due to parameters In-reply-to: <20050902231650.GB289@DervishD> To: Zsh Users Message-id: <1050903035308.ZM22998@candle.brasslantern.com> MIME-version: 1.0 X-Mailer: Z-Mail (5.0.0 30July97) Content-type: text/plain; charset=us-ascii References: <20050902231650.GB289@DervishD> Comments: In reply to DervishD "Bad math expression due to parameters" (Sep 3, 1:16am) 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.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.4 On Sep 3, 1:16am, DervishD wrote: } } [[ $OPTARG -lt 8 ]] && OPTARG=8 } } [when] $OPTARG is "--" and that gives a "bad math expression" in } the test above. } } How can I solve this? Must I validate $OPTARG before messing with } it on a math expression? Either that, or cheat by not using math at all. [[ $OPTARG = <-7> ]] && OPTARG=8 However, I would think you want to treat "--" as a special case before you get as far as doing other stuff with OPTARG.