which version of shell?

Doug Gwyn gwyn at smoke.ARPA
Wed Sep 7 17:14:13 AEST 1988


In article <Sep.6.17.30.58.1988.24757 at athos.rutgers.edu> hedrick at athos.rutgers.edu (Charles Hedrick) writes:
>  at least in our version, there's a compromise mode that lets you
>	get line editing only when you want it (ESC at the beginning
>	of a line invokes the line editor on the previous line)
>  ksh is getting so many features in it that Unix purists are
>	beginning to retch when they look at the manual

One deliberate feature of the BRL Bourne shell is that you don't get any
of the added stuff unless you specifically enable it (with an ENV environment
variable for the per-interactive shell startup file, "set" options for the
other features [capital letters to prevent conflicts with possible standard
sh future extensions]).  We were also careful not to run the per-shell init
stuff for shell scripts, unlike the horrible csh botch in this regard.  We
also couldn't stomach a lot of the ksh additions and either left them out or
found better ways to accomplish them.  For example, here is a function I
define in my ENV file rather than having to build it into the shell (HISTFILE
names the file that gets commands appended to it when the H option is set):

history () {
	( set +u
	if [ -z "$HISTFILE" ]
	then
		echo "HISTFILE not set"
	elif [ $# -lt 1 ]
	then
		tail -50 "$HISTFILE"
	else
		tail -$1 "$HISTFILE"
	fi )
}

By the way, I obtained that as the output of "whatis history", using a
feature inspired by Eighth Edition UNIX.  "whatis" always produces something
that can be fed back to the shell, unlike System V's "type" builtin.  I wish
the System V developers would pay more attention to the Research folks.



More information about the Comp.unix.wizards mailing list