Csh Programming Considered Harmful
Edit Page
Report
Scan day: 16 February 2014 UTC
-2
Virus safety - good
Description: Tom Christiansen's famous essay on csh's deficiencies.
Csh Programming Considered Harmful Csh Programming Considered Harmful From: Tom Christiansen <[email protected]> Newsgroups: comp.unix.shell, comp.unix.questions, comp.unix.programmer, comp.infosystems.www.authoring.cgi Subject: Csh Programming Considered Harmful Date: 6 Oct 1996 14:03:18 GMT Message-ID: <[email protected]> Archive-name: unix-faq/shell/csh-whynot Version: $Id: csh-faq,v 1.7 95/09/28 12:52:17 tchrist Exp Locker: tchrist $ The following periodic article answers in excruciating detail the frequently asked question "Why shouldn't I program in csh?". It is available for anon FTP from perl.com in /pub/perl/versus/csh.whynot.gz *** CSH PROGRAMMING CONSIDERED HARMFUL *** Resolved: The csh is a tool utterly inadequate for programming, and its use for such purposes should be strictly banned! I am continually shocked and dismayed to see people write test cases, install scripts, and other random hackery using the csh. Lack of proficiency in the Bourne shell has been known to cause errors in /etc/rc and .cronrc files, which is a problem, because you *must* write these files in that language. The csh is seductive because the conditionals are more C-like, so the path of least resistance is chosen and a csh script is written. Sadly, this is a lost cause, and the programmer seldom even realizes it, even when they find that many simple things they wish to do range from cumbersome to impossible in the csh. 1. FILE DESCRIPTORS The most common problem encountered in csh programming is that you can't do file-descriptor manipulation. All you are able to do is redirect stdin, or stdout, or dup stderr into stdout. Bourne-compatible shells offer you an abundance of more exotic possibilities. 1a. Writing Files In the Bourne shell, you can open or dup arbitrary file descriptors. For example, exec 2>errs.out means that from then on, stderr goes into errs file. Or what if you just want to throw away stderr and leave stdout alone? Pretty simple operati
Size: 2048 chars
Contact Information
Email: —
Phone&Fax: —
Address: —
Extended: —
WEBSITE Info
Page title: | Csh Programming Considered Harmful |
Keywords: | |
Description: | |
IP-address: | 199.191.58.37 |
WHOIS Info
NS | Name Server:NS1.HE.NET Name Server:NS2.HE.NET Name Server:NS3.HE.NET Name Server:NS4.HE.NET Name Server:A.IAWTP.COM Name Server:D.IAWTP.COM Name Server: Name Server: Name Server: Name Server: Name Server: Name Server: |
WHOIS | Status: ok |
Date | Creation Date: 2004-10-23T08:12:51Z Expiry Date: 2014-10-23T08:12:51Z |