From owner-freebsd-questions@FreeBSD.ORG Thu Jun 24 02:51:03 2010 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68AF6106566B for ; Thu, 24 Jun 2010 02:51:03 +0000 (UTC) (envelope-from aiza21@comclark.com) Received: from avmxsmtp3.comclark.com (avmxsmtp3.comclark.com [202.69.191.117]) by mx1.freebsd.org (Postfix) with ESMTP id 047378FC1A for ; Thu, 24 Jun 2010 02:51:02 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtgRAGtlIkzKRa1mPGdsb2JhbAAHnzgBAQEBNcMBhRsEg1k X-IronPort-AV: E=Sophos;i="4.53,471,1272816000"; d="scan'208";a="4891505" Received: from unknown (HELO [10.0.10.3]) ([202.69.173.102]) by avmxsmtp3.comclark.com with ESMTP; 24 Jun 2010 10:51:01 +0800 Message-ID: <4C22C816.3000105@comclark.com> Date: Thu, 24 Jun 2010 10:51:02 +0800 From: Aiza User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: Thomas References: <4C22B3D7.6070102@comclark.com> <20100624013755.GA5009@gothschlampen.com> In-Reply-To: <20100624013755.GA5009@gothschlampen.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: questions@freebsd.org Subject: Re: .sh check for numeric content X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 02:51:03 -0000 Thomas wrote: > On Thu, Jun 24, 2010 at 09:24:39AM +0800, Aiza wrote: > > Hello, > >> Receiving a variable from the command line that is suppose >> to contain numeric values. >> >> How do I code a test to verify the content is numeric? > > http://www.google.com/search?q=shell+test+if+variable+numeric > > First link => > http://www.unix.com/shell-programming-scripting/46276-check-variable-if-its-non-numeric.html > > Gosh, Google is full of answers these days.. > yea but none of them are for freebsd style .sh shell I'm, using [ "${dup_times}" != [0-9] ] && exerr "value not numeric" and get the errot messahe no mater what value is in dup_times. What is wrong with this code?