From owner-freebsd-questions@FreeBSD.ORG Tue Jan 10 10:15:55 2006 Return-Path: X-Original-To: questions@freebsd.org 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 9826516A41F for ; Tue, 10 Jan 2006 10:15:55 +0000 (GMT) (envelope-from Jan.Grant@bristol.ac.uk) Received: from dirg.bris.ac.uk (dirg.bris.ac.uk [137.222.10.102]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3308243D45 for ; Tue, 10 Jan 2006 10:15:54 +0000 (GMT) (envelope-from Jan.Grant@bristol.ac.uk) Received: from mail.ilrt.bris.ac.uk ([137.222.16.62]) by dirg.bris.ac.uk with esmtp (Exim 4.60) (envelope-from ) id 1EwGXU-0003s8-FR; Tue, 10 Jan 2006 10:15:53 +0000 Received: from cmjg (helo=localhost) by mail.ilrt.bris.ac.uk with local-esmtp (Exim 4.50) id 1EwGXT-0004iA-K6; Tue, 10 Jan 2006 10:15:39 +0000 Date: Tue, 10 Jan 2006 10:15:39 +0000 (GMT) From: Jan Grant X-X-Sender: cmjg@mail.ilrt.bris.ac.uk To: Frank Staals In-Reply-To: <43C2C59A.6020906@gmx.net> Message-ID: References: <43C2BE4A.4070601@gmx.net> <20060109195427.GC89638@dan.emsphone.com> <43C2C59A.6020906@gmx.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: Jan Grant X-Spam-Score: -1.4 X-Spam-Level: - Cc: questions@freebsd.org Subject: Re: Shellscript syntax question 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: Tue, 10 Jan 2006 10:15:55 -0000 On Mon, 9 Jan 2006, Frank Staals wrote: > About the asteriks : No they weren't but for some reason Thunderbird had > problems with the color remaining from the KATE Syntax-hilighting. Anyway: > thanks for the solusion, but what would be the expressions for ">" "less or > equal" and "greater or equal" ? As others have pointed out: [ is a synonym for test(1), which uses -gt, -ge, -eq, -ne, -lt, -le for numeric comparisons. For string comparisons, it uses <, !=, =, and >. Your original expression didn't work because "<" is also a shell meta-character used to indicate file redirection. To get something like that to work, you'd need to quote it somehow: if [ "$a" \< "$b" ]; then ... ; fi or if [ "$a" '<' "$b" ]; then ... ; fi -- jan grant, ISYS, University of Bristol. http://www.bris.ac.uk/ Tel +44 (0)117 3317661 http://ioctl.org/jan/ I'm the dandy information superhighwayman.