From owner-freebsd-questions Tue Jul 9 10: 4:32 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 6677737B400 for ; Tue, 9 Jul 2002 10:04:28 -0700 (PDT) Received: from fw1.wamnet.com (efw1.wamnet.com [67.98.0.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id D0D8D43E42 for ; Tue, 9 Jul 2002 10:04:27 -0700 (PDT) (envelope-from lcarmich@wamnet.com) Received: from ndm.wamnet.com ([172.17.38.2]) by fw1.wamnet.com (8.12.2/8.12.2) with ESMTP id g69H4QKG011356; Tue, 9 Jul 2002 12:04:26 -0500 (CDT) Received: from ds.cops.wamnet.com (ds.cops.wamnet.com [172.17.31.2]) by ndm.wamnet.com (8.9.1a/8.9.1) with ESMTP id MAA2296873; Tue, 9 Jul 2002 12:04:25 -0500 (CDT) Received: from y.dev.wamnet.com (y.dev.wamnet.com [172.17.27.37]) by ds.cops.wamnet.com (980427.SGI.8.8.8/970903.SGI.AUTOCF) via SMTP id MAA33443; Tue, 9 Jul 2002 12:04:25 -0500 (CDT) Date: Tue, 9 Jul 2002 12:04:24 -0500 (CDT) From: Lee J Carmichael X-Sender: lcarmich@y.dev.wamnet.com To: David Smithson Cc: FreeBSD-Questions Subject: Re: How do I repeat a command N times? In-Reply-To: <004201c22769$8468df70$0801a8c0@customfilmeffects.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 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 Damn bash... -------- Lee Carmichael Service Architect - WorkSpace WAM!NET Inc. 655 Lone Oak Rd Building A Eagan, MN 55121 ph# 651-256-5292 email: lcarmich@wamnet.com On Tue, 9 Jul 2002, David Smithson wrote: > Aha. A FOR loop? > > > For ksh: > > > > let x=0 > > let stop=607 > > > > while [[ $x -le $stop ]] > > do > > # whatever you'd like > > echo $x > > let x=$x+1 > > done > > > > I guess you could make 'x' to 'n'... ;) > > > > Take Care, > > > > > Hello friends. I want to repeat a command 607 times and stop. How do I > > > accomplish this besides writing a script that's 607 lines long? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message