shells?

J.B. Nicholson jbn35564 at uxa.cso.uiuc.edu
Tue Apr 16 15:09:22 AEST 1991


In <1455 at irit.irit.fr> pfeiffer at irit.fr (Daniel Pfeiffer) writes:

>I don't need a history or a command line editor, GNU Emacs does that
>better than any shell will ever be able to!

Have you tried emacs mode in KSH?  I'm not familiar with Emacs (GNU or
otherwise), but I find that emacs mode in KSH is great.

>Does some shell just provide improvements over Bourne shell.  Given
>the amount of code that exists for Bourne shell this should be upwards
>compatible.  For example I heard that [ test ] is a built in for ksh.
>Does that mean we have we can say (without ;):
>
>if [ test ] then
>while [ test ] do

Actually, I think what you say in KSH is: (the preferred notation)

if [[ expression_to_be_run ]] then
while [[ expression_to_be_run ]] then

The 'test' notation and the [ notation (according to the KSH book) have
been made obsolete by the [[ ]] notation.

>The only things I miss in Bourne shell is a list type or something
>like that, so I can get at ${27} or ${$#} for command line args, and
>for similar but separate structures of my own.  And it would be nice
>if it could do some clever redirection for builtins and functions in
>pipelines, rather than fork off a subshell for each one.  Then we
>wouldn't have to bend over backwards to set variables, cd and other
>things.

Sounds like KSH is for you!  You can do all that, but ${$#} is the PID
of the command, and not the number of arguments to the command ($# is
this).  I recommend you get the KSH and the book by Morris I. Bolsky
and David G. Korn called the "The Kornshell Command and Programming
Language" (ISBN 0-13-516972-0).  It's a great book and even though I've
only had my copy for about 3 weeks, I've already gained a world of
knowledge from it.

>--
>-- Daniel Pfeiffer				<pfeiffer at cix.cict.fr>
>-- Tolosa (Toulouse), Midi-Pyrenees, Europe	<pfeiffer at irit.fr>
>-- "Beware - polyglot esperantist"		<pfeiffer at frcict81.bitnet>
>--

Jeff
--
+----------------------------------------------------------------------------+
| "If you hear an onion ring - answer it."                    J.B. Nicholson |
+----------------------------------------------------------------------------+
| jeffo at uiuc.edu (Internet)              These opinions are mine, that's all.|
+----------------------------------------------------------------------------+



More information about the Comp.unix.shell mailing list