[net.unix] Why csh instead of sh?

gwyn@BRL-VLD.ARPA (05/14/84)

From:      Doug Gwyn (VLD/VMB) <gwyn@BRL-VLD.ARPA>

test(1) is built into the current Bourne shell (although expr(1) isn't yet).
Perhaps a better use of time instead of converting sh scripts to csh would
be to install a newer Bourne shell.

gam@proper.UUCP (Gordon Moffett) (05/16/84)

#
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.