Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Jul 2000 16:34:12 -0700
From:      Alfred Perlstein <bright@wintelcom.net>
To:        John Baldwin <jhb@pike.osd.bsdi.com>
Cc:        FreeBSD@pike.osd.bsdi.com, questions <freebsd-questions@freebsd.org>, "David J. Kanter" <djkanter@northwestern.edu>
Subject:   Re: Is the C-shell (csh) a bad shell?
Message-ID:  <20000718163411.L13979@fw.wintelcom.net>
In-Reply-To: <200007182310.QAA55420@pike.osd.bsdi.com>; from jhb@pike.osd.bsdi.com on Tue, Jul 18, 2000 at 04:10:47PM -0700
References:  <20000718160249.I13979@fw.wintelcom.net> <200007182310.QAA55420@pike.osd.bsdi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
* John Baldwin <jhb@pike.osd.bsdi.com> [000718 16:11] wrote:
> > * David J. Kanter <djkanter@northwestern.edu> [000718 15:57] wrote:
> > > I'd like to learn a shell fairly well and chose csh because it's in the base
> > > FreeBSD system (a little graybeard character) and I found good documentation
> > > on it written by William Joy. But I've read some things that it's a "bad"
> > > shell.
> > > 
> > > Is it?
> > > 
> > > It seems that, at some level, all shells are essentially equal. But when
> > > shells start to divide is csh left in the dust? What about the shells I've
> > > read rave things about: Korn and Bash.
> > > 
> > > I've got C++ experience, so maybe that's why I chose csh too.
> > 
> >           *** CSH PROGRAMMING CONSIDERED HARMFUL ***
> > 
> >     Resolved: The csh is a tool utterly inadequate for programming, 
> >               and its use for such purposes should be strictly banned!
> > 
> > http://arch.freeciv.org/aclug-l-199811/msg00018.html
> > 
> > -Alfred
> 
> I have found this and similar anti-csh arguments to be largely a matter
> of opinion and personal style rather than having any substance.  The
> same can be said for most programming language wars.  There are two
> rather large shortfalls in csh's language, however.  It does not support
> functions (except perhaps by abusing aliases), and it does not allow the
> same amount of flexibility in I/O redirection.  However, I rarely find
> that I use much of the added flexibility of I/O redirection in sh.  For
> scripts where I need that or where I need functions, I tend to use sh.
> For other scripts I tend to use csh.  Perhaps it's my Pascal background
> showing through, but I prefer if (foo) then endif to if [ foo ]; then fi.
> 
> Basically, I freely use both, and use tcsh as my interactive shell.  There
> is certainly no harm in learning csh, but I would also learn sh as well.

The problem is that most scripts grow, and grow, and grow and.. well. :)

Once you need functions you're SOL, once you need the redirect
functionality you're SOL, syntax doesn't matter, it's the functionality
afforded by the shell and csh doesn't cut it.

-Alfred


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?20000718163411.L13979>