I am sick of the C shell's bugs, eccentricites, and misfeatures.
A good bourne shell would be great, but I would miss some of the nice
features of an interactive shell. I need a shell which:
o Has a clean syntax, simmilar to /bin/sh
(csh syntax *really* gets on my nerves)
o Provides Berkeley job control
o Allows history review, and substitution
o Sources scripts at: shell startup, login, and logout (like /bin/csh)
o Will source logout script on logout *or on SIGHUP*
(how I *hate* csh for not letting me do that!)
o Has command aliases
o Uses ESC for filename completion (a la /bin/csh)
o Is smaller than /vmunix (unlike BASH :-)
o Is devoid of undocumented misfeatures (unlike /bin/csh :-)
o Does not dump core when I explore the darker reaches of its syntax
Does anyobdy know of such a thing, or will I be forced to brew my own?
Congrats. You just defined plain old standard Korn shell (ksh), as it
comes on many (most?) stock Unix systems today (particularly SVR3 or
SVR4 derived versions).
About the only thing different is that filename completion isn't the
same as you describe. Csh is a bit nicer for this.
To address your specific comments:
o Clean syntax.
Syntax is 99% the same as vanilla Bourne Shell, but
-- removes a few obsolete things (like "^" as a pipe instead of "|")
-- removes many stupid "sh" ambiguities, such as when does
redirection occur, and when commands actually run in
subprocesses.
-- removes some stupid "sh" bugs, like destroying argument
Infinitely superior to csh when it comes to screwball things like
quoting characters, nesting conditionals, redirection
of anything besides "stdout", etc.
See what sort of contortions you have to go through with Csh when
you have an alias which includes double-quotes, single-quotes,
backtics, embedded quotes ... !
Of course, you might also regard similarity to Bourne Shell
syntax as a detriment (like me) ... I much prefer the style
of Csh (I think Sh/Ksh's use of keywords like "esac" and "fi"
to be highly annoying), but Ksh functionality still wins.
o Berkeley job control
May be different on different machines. On my machine
(HP-UX 7.0), all the standard things like "^Z", "fg", "bg"
work just fine. I believe this is affected partly by the
underlying Unix and not just the shell you use.
o History review and substitution.
For INTERACTIVE use, ksh blows csh away. This is the
reason I switched from csh to ksh. I hate sh/ksh syntax
(csh syntax is much nicer) but it was worth the change
anyways.
Csh's history mechanism really is only adequate for
non-interactive use, such as in making aliases, or for
simple (and clumsy) interactive changes. For interactive
use, Ksh'es command-line editing mechanisms are a good
deal more obvious and "friendly".
Ksh has a another mechanism (shell functions) which
are more powerful than Csh's alias mechanism.
Ksh also has "aliases", but they're very limited.
o Sources scripts ...
Yes. More flexible than Csh too. Reads ".profile" at login.
Evaluates environment variable ENV at run time, and if it
turns out to be a valid filename, then reads that file
at shell startup time. My ENV definition causes ksh to
read "~/.kshrc" if it's an interactive shell, but nothing
if it is not (makes script files much faster than Csh).
Also can trap signals and execute specific command on receipt
of signal. For example, execute ".logout" on receipt of SIGHUP.
o Filename completion.
Yes, but different than Csh's. Csh is somewhat better here.
o Not overly large.
On my system:
-r-xr-xr-x 1 bin bin 180224 Oct 12 1989 /bin/csh
-r-xr-xr-x 2 bin bin 172032 Oct 25 1989 /bin/ksh
-r-xr-xr-x 2 bin bin 135168 Oct 25 1989 /bin/sh
I also note that Ksh is faster -- Ksh scripts I write are noticeably
faster than the Csh scripts are replaced (for same level of functionality).
Part of this is due to the aforementioned ability to bypass the ".kshrc"
file when executing scripts, but I don't think that's the whole story.
My ".cshrc" isn't that large, but Csh scripts are *slow*.
--Mark--