- csh weirdness

jpn at teddy.UUCP jpn at teddy.UUCP
Thu Apr 3 23:17:46 AEST 1986


In article <132 at qucis.UUCP> promislo at qucis.UUCP (Eric Promislow) writes:
>		1.) First, the Berekely people seem to have a propensity towards
>documenting everything once.  Exactly once.  As Greg mentioned, I recall
>reading somewhere that the shell won't do a history substitution on an
>exclamation point if it is followed by white space or a newline.  I
>don't know where I read it (probably in the csh manual), but I know it
>wasn't mentioned in the test (1) page.  This is the sort of thing that
>causes people to dump on Unix (and C) for overloading operators.

Why SHOULD it be documented in "test(1)"?!?  Conditionals in csh do NOT USE
"test(1)".  In fact, the syntax of csh conditionals is different than test(1).
You must be thinking about sh scripts!

However, it IS documented under "csh", where it ought to be.  What is
unfortunate is the overloading of '!' as the not operator and the history
selector.  I believe this is a historical problem, since history was added
late in csh'es development.  Anyway, it probably ought to be pointed out
in a warning note near the description of conditional expressions.

Thank GOD the berkeley people only document ONCE!  I HATE the VMS manuals!
A better documentation cross reference would be useful, though.

>		If anyone out there has compiled a short but complete guide to
>effective  C-shell programming and usage, we sure could use a copy
>around here.

I'm sure there are books.  I never felt the need for them.  See below.

>	As for my advice, I learned the history mechanism largely by
>trial and error, appreciate the escape-key completion (documented
>nowhere, as far as I can tell) and job-control features, and do all my
>shell programming with the Bourne shell.

Well, escape-key completion is NOT part of the standard C-shell, so
I suspect that you are running a bastardized version of csh.  Why not
ask your system guru (the one who installed the bastardized version!?)

Also, don't you have a copy of "An Introduction to the C shell"  by
William Joy?  It is an online document in /usr/doc/csh on all Berkeley
systems, and it is in our printed manuals too!  I felt that it was
an adequate introduction to all the csh features.  An excerpt from the
introduction:

	 UNIX users who have read a general introduction to  the
    system  will  find a valuable basic explanation of the shell
    here.  Simple terminal  interaction  with  _c_s_h  is  possible
    after  reading just the first section of this document.  The
    second section describes the shells capabilities  which  you
    can  explore  after you have begun to become acquainted with
    the shell.  Later sections introduce features which are use-
    ful, but not necessary for all users of the shell.

	 Back matter includes an appendix listing special  char-
    acters  of  the  shell  and a glossary of terms and commands
    introduced in this manual.



More information about the Comp.bugs.4bsd.ucb-fixes mailing list