From owner-freebsd-questions Mon Feb 26 6:46:30 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mta6.snfc21.pbi.net (mta6.snfc21.pbi.net [206.13.28.240]) by hub.freebsd.org (Postfix) with ESMTP id 4C55737B401 for ; Mon, 26 Feb 2001 06:46:20 -0800 (PST) (envelope-from fscked@pacbell.net) Received: from pacbell.net ([63.204.134.48]) by mta6.snfc21.pbi.net (Sun Internet Mail Server sims.3.5.2000.01.05.12.18.p9) with ESMTP id <0G9D00ACGD02XD@mta6.snfc21.pbi.net> for freebsd-questions@FreeBSD.ORG; Mon, 26 Feb 2001 06:45:38 -0800 (PST) Date: Mon, 26 Feb 2001 06:59:14 -0800 From: richard childers Subject: Re: OT: Which programming shell, sh or csh? To: igorr@crosswinds.net Cc: freebsd-questions@FreeBSD.ORG Message-id: <3A9A6F42.3BAC88A2@pacbell.net> Organization: The Free State of Dis MIME-version: 1.0 X-Mailer: Mozilla 4.73 [en] (WinNT; U) Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Accept-Language: en References: <20010223153105.A17466@tethys.valhalla.net> <20010226093957.A1988@linux.rainbow> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG The issues are as follows (roughly). /bin/sh is the oldest piece of code, hence, the most reliable. It is also the smallest, in terms of executable size, and in olden days this was considered important. /bin/csh is the second oldest piece of code and it has lots of things that /bin/sh forgot. Alas, in the frenzy to create a friendly interface, programming functionality was left out; shocking, but true, /bin/sh has the ability to define reusable functions and pass parameters to these functions and /bin/csh does not. What kinda C shell is that, you ask? You're not the first. There are several other shells which have in various ways attempted to ameliorate the situation; HP and POSIX have blessed the Bourne shell, but with a few changes, so that it is now the POSIX shell. The Bourne-Again Shell (bash) attempts to enrich the user interface while preserving the command syntax of /bin/sh. Et caetera. I would in general recommend /bin/sh - note that all boot scripts are written in /bin/sh. But I, too, do a lot of my quick-and-dirty scripting in csh ... -- richard Igor Robul wrote: > On Fri, Feb 23, 2001 at 03:31:05PM +0000, Mark Drayton wrote: > > > I am writing some small scripts for our users to help them interact > > > with cvs. I have looked at using either sh or csh, but I cannot find > > > any information as to why I would choose one over the other. > > > > I've never used csh myself, but I've read several documents saying it > > shouldn't be used. See Tom Christiansen's article for more info: > Most of _my own_ scripts are written in csh. But generally, sh is > better for programming than csh. > > -- > Igor Robul, Unix System Administrator & Programmer @ sanatorium "Raduga", > Sochi, Russia > http://www.brainbench.com/transcript.jsp?pid=304744 > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message -- Richard A. Childers Senor UNIX Administrator fscked@pacbell.net (email) 203.556.8471 (voice/msgs) # Providing administrative expertise (not 'damage control') since 1986. # PGP fingerprint: 7EFF 164A E878 7B04 8E9F 32B6 72C2 D8A2 582C 4AFA To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message