Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site proper.UUCP Path: utzoo!watmath!clyde!akgua!sdcsvax!sdcrdcf!hplabs!hpda!fortune!amd70!dual!proper!gam From: gam@proper.UUCP (Gordon Moffett) Newsgroups: net.unix Subject: Why csh instead of sh? (includes free flame!) Message-ID: <1206@proper.UUCP> Date: Wed, 16-May-84 01:28:48 EDT Article-I.D.: proper.1206 Posted: Wed May 16 01:28:48 1984 Date-Received: Sun, 13-May-84 08:22:37 EDT References: <1192@proper.UUCP>, <1525@brl-vgr.ARPA> Organization: Proper UNIX, Oakland, CA Lines: 30 Keywords: C-shell,Bourne shell,scripts,translators,test(1),expr(1) # In response to my request for a sh -> csh translator, I have already received two letters asking `WHY would you want to do that?' and now I find that question posted to the net, so perhaps I can forstall a deluge. But first, a slight flame: I guess you are all trying to be helpful warning me against the evils of csh, but THAT WASN'T MY QUESTION! I found this as annoying as asking about a good truffle shop and being asked `Why would you eat chocolate? It has caffiene in it! ...' and so on. Annoying. Questioning people's preferences is pointless. Now, why csh? Because the particular script I want to translate is heavily into using the test(1) and expr(1) commands, which are already built-in to csh. Yes, there will be overhead with a csh script start-up, reading ~/.cshrc and all, but this will be offset by the numerous calls to test and expr that I won't be using. (As Kernighan & Pike point out, judicious use of sh's `case' construct will avoid having to call test(1) in some cases -- for pattern matching/string comparison -- but I've already done that as much as possible). I generally prefer the speed of sh scripts and resort to csh for instances like I have described above (though my login shell is csh, nonetheless). I believe we've already had a round of `csh vs sh' before, and I don't wish to provoke another one.