sh vs csh

sunny at decwrl.UUCP sunny at decwrl.UUCP
Sat Sep 15 02:32:28 AEST 1984


Greetings:

	It would seem, that in this eternal war of "my way is better"
that perhaps both sides can be right at the same time.

	The Bourne shell does things like catching interrupts better
than the C shell does, so if you've got some peculiar ideas in mind
about how some script should handle interrupts, use the Bourne shell.

	On the other hand, for you everyday top level shell, I find
that the power of the alias command in the C shell is indispensible:
Just as a Macro assembler allows higher level functions to facilitate
programming, the alias command allows higher level commands to help
you with interactive programming of the machine.

	If you think of your .profile or .cshrc as merely a vehicle
for performing simple defaulting and initialization of a few system
parameters, then that's all you get.  On the other hand, if you use
your .cshrc file to "redefine" the command set of the machine by
giving yourself high level macro commands (aliases), then you can
improve the speed of your interaction greatly, through reduced
typing, and thinking, to get a given function done.

	Unix is all about pipes and filters.  Csh aliases give you
the power of both *without* having to take the time to read a file
from the disk (a shell script, or filter).  When you can look at 
your command history (csh, again) and see that most of the commands
you execute are aliases rather than raw Unix commands, then you'll
know you've optimized the command structure to the way *you* work.
It's trivial to invoke a sh script from a csh alias.  Why not? Set
the sticky bits on both sh and csh, and it'll always work quickly.
-- 
{ucbvax|decvax|ihnp4}!sun!sunny (Sunny Kirsten of Sun Microsystems)



More information about the Comp.unix.wizards mailing list