From owner-freebsd-questions Tue Jul 9 20:13:50 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 1B5AE37B400 for ; Tue, 9 Jul 2002 20:13:47 -0700 (PDT) Received: from mail7.nc.rr.com (fe7.southeast.rr.com [24.93.67.54]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4D97F43E54 for ; Tue, 9 Jul 2002 20:13:46 -0700 (PDT) (envelope-from bts@babbleon.org) Received: from i8k.babbleon.org ([66.57.86.84]) by mail7.nc.rr.com with Microsoft SMTPSVC(5.5.1877.757.75); Tue, 9 Jul 2002 23:07:42 -0400 Received: by i8k.babbleon.org (Postfix, from userid 111) id 6F186BA05; Tue, 9 Jul 2002 23:07:37 -0400 (EDT) Content-Type: text/plain; charset="iso-8859-1" From: Brian T.Schellenberger To: "James" , "David Smithson" , "FreeBSD-Questions" Subject: Re: How do I repeat a command N times? Date: Tue, 9 Jul 2002 23:07:36 -0400 X-Mailer: KMail [version 1.3] References: <006801c2276b$f703f1d0$0801a8c0@customfilmeffects.com> <001001c2276c$bacddcc0$0301a8c0@sys.gtei.net> In-Reply-To: <001001c2276c$bacddcc0$0301a8c0@sys.gtei.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <20020710030737.6F186BA05@i8k.babbleon.org> 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 Tuesday 09 July 2002 01:19 pm, James wrote: | I'm still new, but: | It's probably your shell. | The C-Shell (csh) isn't good for programming scripts. Oh, poppycock. C-Shell is perfectly fine for programming scripts. It's just that you can't give ksh syntax to the csh. Really more a matter of what you are used to than anything else; that square-bracket gibberish gives me the heeby-jeebies. Anyway, in csh: #! /bin/csh # whatever the count was here; I forget set count = 327 while ($count > 0) echo hello @ count-- end which is to my mind a lot more readable and C-like (thus the name, "csh"). | Try changing to the Bourne shell (sh) and running it again. | Switch to the Bourne shell simply by typing "sh" | | I was messing with some basic script programs yesterday (though I haven't | learned Perl yet), and it would not work (I had similar errors) unless I | switched back to the Bourne shell. | | I think you might be able to program the C-Shell with C like statements, | but I'm still learning. | | Hope this helps! | -James Turnbull | ----- Original Message ----- | From: "David Smithson" | To: "FreeBSD-Questions" | Sent: Tuesday, July 09, 2002 10:13 AM | Subject: Re: How do I repeat a command N times? | | > Wow! So many options. | > | > Perl returns: "Badly placed ( " | > | > My shell is csh | > | > CSH returns "let: arith: syntax error: 'x=+1'" , yet continues and works. | > What's with the error? | > | > | > To Unsubscribe: send mail to majordomo@FreeBSD.org | > with "unsubscribe freebsd-questions" in the body of the message | | To Unsubscribe: send mail to majordomo@FreeBSD.org | with "unsubscribe freebsd-questions" in the body of the message -- Brian, the man from Babble-On . . . . bts@babbleon.org (personal) http://www.babbleon.org http://www.eff.org http://www.programming-freedom.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message