Which shell language should I use?

Jeffrey Kegler jeffrey at algor2.UUCP
Sat May 6 08:50:45 AEST 1989


First, every UNIX programmer should know how to use plain old sh (and ed, for
that matter).  Every once in a while you have no other choice.  So if you
do not know sh, that is the one to learn first.

Which should be your shell of preference is more a matter of taste.  Before
the Korn shell came along, I was a big user of csh.  The major problem with
csh is that it is not Bourne shell (that is, sh) compatible.  I wind up moving
around a lot and changed shell syntax has gotten to be too much trouble for
me.  Now I never bother with csh any more, and use the Korn shell if I have
it, the Bourne shell if I do not.

One of the main reasons I stopped using csh is the issue of shell scripts.  If
you desire portability, it is risky to write a shell script in anything but
the Bourne shell.  Also, for heavy duty shell programming, the Bourne and
Korn shells are better than csh.  Not to go into details, but redirection of
input and output from while and for constructs in very useful, and not 
available in csh.

To summarize:
1.) If you do not know the Bourne shell, sh, learn it before doing anything
else.
2.) Pick an interactive shell of preference.  If you are reasonably sane, it
will be ksh or csh.  I prefer ksh.
3.) Always write shell scripts in sh.
-- 

Jeffrey Kegler, President, Algorists,
jeffrey at algor2.UU.NET or uunet!algor2!jeffrey
1762 Wainwright DR, Reston VA 22090



More information about the Comp.unix.questions mailing list