From owner-freebsd-questions Tue Apr 7 01:09:36 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id BAA16328 for freebsd-questions-outgoing; Tue, 7 Apr 1998 01:09:36 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from allegro.lemis.com (allegro.lemis.com [192.109.197.134]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id BAA16321 for ; Tue, 7 Apr 1998 01:09:32 -0700 (PDT) (envelope-from grog@lemis.com) Received: from freebie.lemis.com (freebie.lemis.com [192.109.197.137]) by allegro.lemis.com (8.8.7/8.8.5) with ESMTP id RAA12544; Tue, 7 Apr 1998 17:38:52 +0930 (CST) Received: (from grog@localhost) by freebie.lemis.com (8.8.8/8.8.7) id RAA07600; Tue, 7 Apr 1998 17:38:52 +0930 (CST) (envelope-from grog) Message-ID: <19980407173852.47780@freebie.lemis.com> Date: Tue, 7 Apr 1998 17:38:52 +0930 From: Greg Lehey To: Dean Hollister , FreeBSD Questions Subject: Re: bash question References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89i In-Reply-To: ; from Dean Hollister on Tue, Apr 07, 1998 at 02:09:11PM +0800 WWW-Home-Page: http://www.lemis.com/~grog Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, 7 April 1998 at 14:09:11 +0800, Dean Hollister wrote: > > Hi, > > Just a quick (and no doubt easy question). I have a bash script, and want > to check if a value is greater than 100 and less than 1000. I get as far > as: > > if [ $value what goes in here? ]; then > dosomething > fi if [ $value -gt 100 -a $value -lt 1000 ]; then dosomething fi It's in the man page for test(1). The name [ is a synonym for test: $ ls -l /bin/[ /bin/test -r-xr-xr-x 2 bin bin 45056 Mar 27 14:30 /bin/[ -r-xr-xr-x 2 bin bin 45056 Mar 27 14:30 /bin/test Greg To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message