From owner-freebsd-questions@FreeBSD.ORG Mon Jan 9 20:32:22 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 EF6B016A41F for ; Mon, 9 Jan 2006 20:32:22 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1876B43D72 for ; Mon, 9 Jan 2006 20:32:19 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.1/8.13.3) id k09KWDmP064155; Mon, 9 Jan 2006 14:32:13 -0600 (CST) (envelope-from dan) Date: Mon, 9 Jan 2006 14:32:13 -0600 From: Dan Nelson To: Frank Staals Message-ID: <20060109203212.GD89638@dan.emsphone.com> 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 Content-Disposition: inline In-Reply-To: <43C2C59A.6020906@gmx.net> X-OS: FreeBSD 5.4-STABLE X-message-flag: Outlook Error User-Agent: Mutt/1.5.11 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: Mon, 09 Jan 2006 20:32:23 -0000 In the last episode (Jan 09), Frank Staals said: > Dan Nelson wrote: > >In the last episode (Jan 09), Frank Staals said: > > > >>I'm trying to write a ( simple ) shellscript to move files arround, > >>for this reason I wanted to check wether 'episode_last' has a > >>higher value than 'episode_first' ( so that last can't be 3 if > >>first is 60). So I tried : > >> > >>*if** [* ${episode_last} < ${episode_first}* ]*; *then > >> > >>fi > >> > >>*As I thought what would have been the correct syntax, but I got this > >>error when running the script : > >>./massmove: line 136: 05: No such file or directory > >> > >> > >>'05' was the value of $episode_first and '01' was the value of > >>$episode_last > > > >You want "-lt" not "<". "<" is a file redirect, which is why the > >shell complained that it couldn't find a file named "05". I also > >assume all those asterisks aren't in your script. > > 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" ? See the "test" manpage. -gt, -le, -ge. -- Dan Nelson dnelson@allantgroup.com