Seeking alternative to /bin/csh

Seeking alternative to /bin/csh

Post by Jamie Mas » Tue, 30 Jul 1991 15:18:55



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?

"That's not an insect, it's a feature!"
"That's not a bug, it's an arachnid!"

Jamie

 
 
 

Seeking alternative to /bin/csh

Post by Suleyman Kondak » Tue, 30 Jul 1991 19:13:18


-->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?

-->"That's not an insect, it's a feature!"
-->"That's not a bug, it's an arachnid!"

-->Jamie

Have you ever tried to use KornShel? It is also excellent as a programming
language which can run B-shel scripts without much modification (or not
at all).

See also the book: The KornShell, M. I . Bolsky and D. G. Korn.

SK.

 
 
 

Seeking alternative to /bin/csh

Post by Stew Ell » Wed, 31 Jul 1991 21:39:45



>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 :-)

         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Quote:>    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?
>"That's not an insect, it's a feature!"
>"That's not a bug, it's an arachnid!"
>Jamie

Particularly with reference to the statement comparing the size of bash with
/vmunix, I was horrified to discover that bash108 yielded an executable of
about 750K on my Sun 3, which if I tuned my kernel might be larger than
vmunix.  I got rid of all of the debugging stuff and turned on some
optimization and got a 3x reduction.  Following is the "ls -l" output for
all of the shells and /vmunix on my Sun 3.  Inspection will reveal that my
bash is closer to the size of ksh and csh than to the size of /vmunix ;^})>

-rwxr-xr-x  1 root       114688 Feb  8  1990 /bin/csh
-rwxr-xr-x  1 stew       172032 Feb 11 01:46 /bin/ksh
-rwxr-xr-x  1 root        73728 Feb  8  1990 /bin/sh
-rwxr-xr-x  1 stew       262144 Jun 12 10:59 /usr/local/bin/bash
-rwxr-xr-x  1 root      1197817 Feb 11 01:04 /vmunix

------------------------------------------------------------------------

                                             _________________________________
  R.Stewart (Stew) Ellis                    / _______________________________/
  Assoc. Prof. of Social Science           / /      ______  ____________  __
  Dept. of Humanities & Social Science    / /      /___  / / ___  ___  / / /
  GMI Engineering & Management Institute / /          / / / /  / /  / / / /
  1700 W. Third Avenue                  / /__________/ / / /  / /  / / / /
  Flint, MI 48504                      /______________/ /_/  /_/  /_/ /_/
  313-762-9765 Office                 ENGINEERING & MANAGEMENT INSTITUTE  


  "Apple Macintosh, the closed system for people with supposedly open minds."
    - plagiarized from someone else on the net
  "How you gonna do it? PS/2 it!" - stupid IBM ad
  "Have you ever heard anything so half-OSsed?" - me

 
 
 

Seeking alternative to /bin/csh

Post by Mark Lan » Wed, 31 Jul 1991 20:37:56



    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--