[comp.lang.forth] Shells

wmb@ENG.SUN.COM (04/13/91)

>   'sh' was "adequate" but someone bothered to write 'csh'.  'csh' was
>   adequate, but someone wrote 'ksh'.  'ksh' is good, but someone writes
>   'bash' anyway.

Just because someone did it doesn't mean that it was a good idea.

Except for obscure and rarely-encountered differences, ksh scripts are
compatible with sh scripts.  ksh can be viewed as sh with improvements
to the interactive editing functions (sh doesn't even *have* an interactive
command editor; it uses the editing functions in the Unix kernel tty driver).
Korn did the write thing; he didn't invent a new language, he just did
a better implementation of an existing one.

I think that csh was ultimately a mistake (I'll ask Bill Joy what he
thinks about this next time I see him).  Csh improved upon sh by adding
history and job control.  Both those features could have been added
without changing the scripting language.  Csh's scripting language is
not any better than sh's, it is just different.  It is a pain having
to remember both.  Most people "in the know" avoid using csh for scripts.

"bash" was written for the simple reason that the freeware people can't
bear the thought of paying for somebody else's work.  You have to pay
actual money for ksh; it isn't "free" ("free" means that somebody else
paid for it and you are going along for the ride).  As I recall, bash's
scripting language is the same as sh (or maybe csh, but I think sh).
By the way, ksh will be bundled with SVR4 Unix, so you will no longer
have to pay extra for it when SVR4 comes out.

In the sense that I was talking about, these 4 shells are not really
4 different languages, they are 4 implementations of 2 languages.
All in all, I think everybody would be better off if they were 4
implementations of 2 languages.  Personally, I get bored with having
to remember both:

        for file in *.fth; do
        echo $file
        done
and
        foreach file (*.fth)
        echo $file
        end

Mitch Bradley, wmb@Eng.Sun.COM