Re: check for numeric content in a shell script (FreeBSD sh)

2010-06-25 Thread parv
in message 20100624192256.gf...@libertas.local.camdensoftware.com, wrote Chip Camden thusly... On Jun 24 08:39, Parv wrote: in message 20100624183407.ga49...@holstein.holy.cow, wrote p...@pair.com thusly... # Matches a number, either positive (without '+' sign) or # negative,

Re: check for numeric content in a shell script (FreeBSD sh)

2010-06-24 Thread parv
in message 87d3vgmj1s@cjlinux.localnet, wrote Carl Johnson thusly... Carl Johnson ca...@peak.org writes: Carl Johnson ca...@peak.org writes: vogelke+u...@pobox.com (Karl Vogel) writes: On Thu, 24 Jun 2010 09:24:39 +0800, Aiza aiz...@comclark.com said: A Receiving a variable

Re: check for numeric content in a shell script (FreeBSD sh)

2010-06-24 Thread Parv
in message 20100624183407.ga49...@holstein.holy.cow, wrote p...@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

Re: check for numeric content in a shell script (FreeBSD sh)

2010-06-24 Thread Chip Camden
On Jun 24 08:39, Parv wrote: in message 20100624183407.ga49...@holstein.holy.cow, wrote p...@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

Re: check for numeric content in a shell script (FreeBSD sh)

2010-06-24 Thread Carl Johnson
p...@pair.com writes: if expr $arg : [1-9]*\.\{0,1\}[0-9]*$ /dev/null That regex considers . a number but not 0.9 (this one seems to be due to typo) nor a negative number. I had been pointing out an error in the regular expression that someone else had posted, but I obviously didn't do