Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Jul 2002 02:25:57 -0400
From:      Brian T.Schellenberger <bts@babbleon.org>
To:        Agent Drek <drek@smashpow.net>
Cc:        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:  <20020710062558.8FF57BA05@i8k.babbleon.org>
In-Reply-To: <Pine.BSF.4.44.0207100033280.315-100000@bang.smashpow.net>
References:  <Pine.BSF.4.44.0207100033280.315-100000@bang.smashpow.net>

next in thread | previous in thread | raw e-mail | index | archive | help
[Mr. Drek: ammended from what I sent to just you.]

On Wednesday 10 July 2002 12:34 am, Agent Drek wrote:
| On Tue, 9 Jul 2002, Brian T.Schellenberger wrote:
| > 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?
| >
| > 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.
|
| <snip>
|
| well if no-one is has posted the link yet:
|
| http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/
|
| :)


Don't expect to convert me.

For things of the complexity where most of this stuff really matters these 
days I use perl.

For the trivial, csh is easier.

But for years (I started using csh in 1981) I programmed in csh as my primary 
scripting language (using awk where csh didn't cut it) and it's quite usable 
and a lot easier to read.

Also a lot of the problems he cites provably don't happen with modern csh, 
and speaking as somebody who's been using it for 21 years now (yikes!) I 
can't recall that they ever bit me.

The one exception is quoting.  csh did screw up quoting rules real bad.  I use

setenv S '$'
setenv Q '"'

to work around it, but even I will admit that this is a horrible kludge.

I never switched to ksh 'cause I couldn't give up the a{c,c}e globbing of 
csh.  I'm sure it's available in other shells by now, but boy is it hard to 
switch when your csh experience is old enough to buy itself a drink!

 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

However, I will admit that it's probably not best to steer a newbie to 
programming in csh.  But by the same token I'd suggest that people should 
stay away from sh, ksh, zsh, and all those others.

If you are going to write a script, and you don't already know any of those, 
just learn perl.

It's at this point widely enough available that it's a good practical 
assumption that it's always available everywhere, and it's a much better 
language for scripting.



-- 
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020710062558.8FF57BA05>