From owner-freebsd-questions Tue Jul 9 14:44:54 2002 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 9A18A37B400 for ; Tue, 9 Jul 2002 14:44:51 -0700 (PDT) Received: from server.rucus.ru.ac.za (server.rucus.ru.ac.za [146.231.115.1]) by mx1.FreeBSD.org (Postfix) with SMTP id 454A443E42 for ; Tue, 9 Jul 2002 14:44:48 -0700 (PDT) (envelope-from drs@rucus.ru.ac.za) Received: (qmail 64572 invoked from network); 9 Jul 2002 21:44:44 -0000 Received: from shell-fxp1.rucus.ru.ac.za (HELO shell.rucus.ru.ac.za) (10.0.0.1) by server.rucus.ru.ac.za with SMTP; 9 Jul 2002 21:44:44 -0000 Received: (qmail 22642 invoked by uid 10032); 9 Jul 2002 21:44:44 -0000 Date: Tue, 9 Jul 2002 23:44:44 +0200 From: David =?iso-8859-1?Q?Sieb=F6rger?= To: Lee J Carmichael Cc: David Smithson , FreeBSD-Questions Subject: Re: How do I repeat a command N times? Message-ID: <20020709214444.GA22193@rucus.ru.ac.za> References: <004201c22769$8468df70$0801a8c0@customfilmeffects.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.4i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue 2002-07-09 (12:04), Lee J Carmichael wrote: > The 'for' loops in bash, ksh, sh don't do the c-style for processing, > these are more perl like loops (iterate through a list of thingys like (a > b c). > > BTW, the loop below needs to be changed slightly for bash, here is the > bash version: > > let x=0 > let stop=607 > > while [ $x -le $stop ] > do > echo $x > let x=$x+1 > done bash has a for loop: for (( x=0 ; x<=607 ; x++ )) ; do echo $x done There's no need to involve Perl in a simple problem like this. -- David Siebörger drs@rucus.ru.ac.za To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message