From owner-freebsd-questions@FreeBSD.ORG Thu Jun 24 19:23:02 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60209106566B for ; Thu, 24 Jun 2010 19:23:02 +0000 (UTC) (envelope-from sterling@camdensoftware.com) Received: from wh2.interactivevillages.com (wh2.interactivevillages.com [75.125.250.34]) by mx1.freebsd.org (Postfix) with ESMTP id 361668FC14 for ; Thu, 24 Jun 2010 19:23:02 +0000 (UTC) Received: from 174-21-99-21.tukw.qwest.net ([174.21.99.21] helo=_HOSTNAME_) by wh2.interactivevillages.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1ORrrw-0004ug-3I; Thu, 24 Jun 2010 12:13:49 -0700 Received: by _HOSTNAME_ (sSMTP sendmail emulation); Thu, 24 Jun 2010 12:22:56 -0700 Date: Thu, 24 Jun 2010 12:22:56 -0700 From: Chip Camden To: freebsd-questions@freebsd.org Message-ID: <20100624192256.GF557@libertas.local.camdensoftware.com> Mail-Followup-To: freebsd-questions@freebsd.org, Carl Johnson References: <4C22B3D7.6070102@comclark.com> <20100624033257.2D074BEA6@kev.msw.wpafb.af.mil> <87lja4mlme.fsf@cjlinux.localnet> <87hbksmk6y.fsf@cjlinux.localnet> <87d3vgmj1s.fsf@cjlinux.localnet> <20100624183407.GA49923@holstein.holy.cow> <20100624183933.GA50443@holstein.holy.cow> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100624183933.GA50443@holstein.holy.cow> User-Agent: Mutt/1.4.2.3i Company: Camden Software Consulting URL: http://camdensoftware.com X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - wh2.interactivevillages.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - camdensoftware.com Cc: Carl Johnson Subject: Re: check for numeric content in a shell script (FreeBSD sh) 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 19:23:02 -0000 On Jun 24 08:39, Parv wrote: > in message <20100624183407.GA49923@holstein.holy.cow>, > wrote parv@pair.com thusly... > > > > # Matches a number, either positive (without '+' sign) or > > # negative, which is either a whole number; or a real number > > # ending with decimal point, or a real number with or without > > # leading digits before the decimal point. > . ^ > . ^ plural > > ^ > > -? > > ( > > [0-9] [.]? [0-9]* > > | > > [0-9]? [.] [0-9]+ > . ^ > . ^ oops > > Please change the immediately above regex portion to ... > > [0-9]* [.] [0-9]+ > > > - parv We still need to be able to handle numbers without a decimal. Try this: [0-9]*\.?[0-9]+ The question mark says "0 or 1" > > > ) > > $ > > -- > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" -- Sterling (Chip) Camden http://camdensoftware.com | http://chipstips.com | http://chipsquips.com