From owner-freebsd-questions@FreeBSD.ORG Sun May 15 18:30:22 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 89B8416A4CE for ; Sun, 15 May 2005 18:30:22 +0000 (GMT) Received: from gaia.nimnet.asn.au (nimbin.lnk.telstra.net [139.130.45.143]) by mx1.FreeBSD.org (Postfix) with ESMTP id 07B7F43DD0 for ; Sun, 15 May 2005 18:30:20 +0000 (GMT) (envelope-from smithi@nimnet.asn.au) Received: from localhost (smithi@localhost) by gaia.nimnet.asn.au (8.8.8/8.8.8R1.4) with SMTP id EAA18638 for ; Mon, 16 May 2005 04:30:14 +1000 (EST) (envelope-from smithi@nimnet.asn.au) Date: Mon, 16 May 2005 04:30:13 +1000 (EST) From: Ian Smith To: freebsd-questions@freebsd.org Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: simple? sh problen X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2005 18:30:22 -0000 Hopefully not too OT .. the only silly question being the unasked one .. How do I test whether a sh argument is an integer or not, so as to avoid failing on a syntax error from otherwise working code such as: [ $3 -lt 10 -o $3 -gt 600 ] && echo "$0 $1 $2: $3 invalid" && exit 1 when $3 is a non-integer argument? Do I need to delve into awk and REs, or is there something more simple I've missed in mans test, expr, etc? Cheers, Ian