Date: Tue, 9 Jul 2002 23:07:36 -0400 From: Brian T.Schellenberger <bts@babbleon.org> To: "James" <effdefender@earthlink.net>, "David Smithson" <david@customfilmeffects.com>, "FreeBSD-Questions" <freebsd-questions@FreeBSD.ORG> Subject: Re: How do I repeat a command N times? Message-ID: <20020710030737.6F186BA05@i8k.babbleon.org> In-Reply-To: <001001c2276c$bacddcc0$0301a8c0@sys.gtei.net> References: <Pine.SGI.3.96.1020709115845.295966F-100000@y.dev.wamnet.com> <006801c2276b$f703f1d0$0801a8c0@customfilmeffects.com> <001001c2276c$bacddcc0$0301a8c0@sys.gtei.net>
index | next in thread | previous in thread | raw e-mail
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" <david@customfilmeffects.com>
| To: "FreeBSD-Questions" <freebsd-questions@FreeBSD.ORG>
| 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
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020710030737.6F186BA05>
