From owner-freebsd-questions@FreeBSD.ORG Mon Jan 9 19:54:42 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 179A816A423 for ; Mon, 9 Jan 2006 19:54:42 +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 5621643D70 for ; Mon, 9 Jan 2006 19:54:36 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.1/8.13.3) id k09JsSNI091105; Mon, 9 Jan 2006 13:54:28 -0600 (CST) (envelope-from dan) Date: Mon, 9 Jan 2006 13:54:28 -0600 From: Dan Nelson To: Frank Staals Message-ID: <20060109195427.GC89638@dan.emsphone.com> References: <43C2BE4A.4070601@gmx.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <43C2BE4A.4070601@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 19:54:42 -0000 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. -- Dan Nelson dnelson@allantgroup.com