Help needed with conditional statement for alias in csh

karl_kleinpaste at cis.ohio-state.edu karl_kleinpaste at cis.ohio-state.edu
Fri Sep 21 22:52:23 AEST 1990


dkeisen at Gang-of-Four.Stanford.EDU writes:
   && and || both work exactly the opposite of how one would expect them to 
   work (and of how they do in fact work in the Bourne shell).

Yet another vendor shipping a positively prehistoric incantation of
csh.

The version of csh which had inverted sense of || and && existed in
the vicinity of 2.8BSD.  This dates it in the vicinity of 1981 or
1982.  It has long been fixed in more recent versions.  However, that
version is by far the easiest thing to port to SysV (until Rel4) since
it lacked any concept of the "new" tty driver, jobs, and a variety of
other things.

All these vendors (SCO, Microsoft, Microport, Everex) shipping ancient
csh should invest a little time in upgrading their sources for csh to
include features in recent versions.  For example, all these versions
lack (as I recall) the eval builtin and the directory stack as well.
(I was at a Waldenbooks the other night and came across a book on SCO
Xenix.  In the chapter [an entire chapter!] describing csh, one of the
first things shown is a set of aliases to simulate the builtin
directory stack of a proper csh.)  There's no excuse for taking this
LCD approach to csh -- yes, csh is pretty grotesque, but the very
least the vendors could do is pick up an old csh that can be ported,
and a new csh with bugs fixed and common features in place, and merge
the two to create something reasonable.

I did exactly such a thing with exactly such a csh (2.8BSD version) 6
years ago.  It isn't tough; it isn't even particularly time-consuming.
The directory stack and the eval builtin code can be inhaled whole.

--karl
once-semi-proud creator
of a SysVRel1-compatible
job-controllified csh
based on 2.8BSD csh
(SIGTSTP emulated on SIGQUIT)



More information about the Comp.unix.shell mailing list