From owner-freebsd-questions Tue Jul 18 17:30:26 2000 Delivered-To: freebsd-questions@freebsd.org Received: from pike.osd.bsdi.com (pike.osd.bsdi.com [204.216.28.222]) by hub.freebsd.org (Postfix) with ESMTP id 219A337B81B for ; Tue, 18 Jul 2000 17:30:24 -0700 (PDT) (envelope-from jhb@pike.osd.bsdi.com) Received: (from jhb@localhost) by pike.osd.bsdi.com (8.9.3/8.9.3) id RAA57401; Tue, 18 Jul 2000 17:30:11 -0700 (PDT) (envelope-from jhb) From: John Baldwin Message-Id: <200007190030.RAA57401@pike.osd.bsdi.com> Subject: Re: Is the C-shell (csh) a bad shell? In-Reply-To: <20000718163411.L13979@fw.wintelcom.net> from Alfred Perlstein at "Jul 18, 2000 04:34:12 pm" To: Alfred Perlstein Date: Tue, 18 Jul 2000 17:30:11 -0700 (PDT) Cc: questions , "David J. Kanter" X-Mailer: ELM [version 2.4ME+ PL68 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > 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 Hmm, I don't seem to normally run into that problem. In general, I follow the Unix model of having each script perform a simple task, and building more complex scripts by calling other scripts, which basically means that I use functions by mapping 1 script per function. I also do tend to make my scripts rather generic so that they can be used in several tasks w/o needing lots of extension and hacking. (It helps that they usually aren't really long, messy scripts.) -- John Baldwin To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message