Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!amdcad!ames!haven!ncifcrf!nlm-mcs!adm!smoke!gwyn From: gwyn@smoke.ARPA (Doug Gwyn ) Newsgroups: comp.unix.wizards Subject: Re: which version of shell? Message-ID: <8449@smoke.ARPA> Date: 7 Sep 88 07:14:13 GMT References: <2910@dunkshot.mips.COM> <194@cvbnet2.UUCP> <8433@smoke.ARPA> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 35 In article hedrick@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.