Bourne shell modifications, past and future (long)

Arnold Robbins arnold at gatech.CSNET
Thu Nov 14 06:51:47 AEST 1985


Back in early June, I posted, to mod.sources, modifications to the
Bourne shell that provided the following features:

(to quote from the README file I shipped out)
> 1.  BSD style job control on Berkeley Systems. Code to outwit symbolic
>     links for shells which have 'pwd' built in.  Also code to print a
>     resource usage summary after every command on BSD systems.  These are
>     courtesy of the folks at BRL, who gave me permission to post their
>     code.
> 
> 2.  The ability to catch Control-D's, and force you to use "exit", also
>     courtesy of BRL.  This will work whether or not you are on a BSD system.
> 
> 3.  The <> I/O redirecter is now documented, and also works (courtesy of
>     ihnp4!trwrb!lcc!brian's recent posting in net.unix-wizards).
> 
> 4.  The shell parameter $+ gives you the parent process id of the shell.
>     It will track the value of the getppid() system call.
> 
> 5.  The shell will read in $HOME/.shrc on startup, if that file exists.
>     This file is read *after* /etc/profile and $HOME/.profile (unlike the
>     csh, which readc ~/.cshrc before ~/.login).
> 
> 6.  The ~ and ~person notation is understood, both for command line arguments,
>     and in the PATH and CDPATH shell variables.
>  
> 7.  Special sequences in PS1 (the shell's prompt string) will print useful
>     info at the prompt.  Currently, you can get or all or some or none of:
> 	the time of day
> 	your current directory (if the shell has pwd is built in)
> 	your machine's hostname
> 	your login name
> 	the current 'event' number for the ...
> 
> 8.  History mechanism.  The history mechanism is powerful, yet easy to use.
>     Although different from the csh's, it is somewhat more general and
>     orthogonal.  The shell will save history across login sessions,
>     automatically restoring on login, and saving on exit or on the exec builtin.
> 
> On a Pyramid, the shell has some additional capabilities:
> 
> 9.  The 'att', 'ucb' and 'universe' commands are built in.
> 
> 10. The $UNIVERSE shell variable tracks the current universe.
> 
> 11. An additional sequence for the prompt to print the current universe.

Since that time, my shell has been pretty well received. It has not caused
wholesale occurrences of "rm /bin/csh", but it has helped a lot of people.
(If you didn't get the mods, the mod.sources moderator can make arrangements to
get it to you. It is also available for ARPA ftp access from seismo.)

I have received a lot of mail, with suggestions and bug fixes and enhancements.
Here is a list of what I am planning on doing for my next iteration (I am about to
start):

	Numerous bug fixes

	A few more prompting sequences, including for PS2

	As much ksh compatibility as is feasible
		$ENV handling in favor of ~/.shrc
		$PPID instead of $+
		$PWD and $OLDPWD
		~+, and ~-

	expr(1) as a built-in command

	Enhanced operation of att and ucb builtins on a pyramid

	Reimplementing the history mechanism from scratch, including
		a limit on the number of saved commands that will be
		printed by 'history', and an enhancement to make frequent
		operations easier (!$ will work). Also a way to just
		print the history result, without executing it.
	
	tcsh(1) twenex expansion!! (courtesy of celerity!barto, who ripped
		it out of tcsh and made it work with sh.)
	
	Several other small things.

Things that I will NOT add to the Bourne shell are:

	Command aliasing

	Arrays of shell variables (both ala ksh)

I am posting this to request feedback from the net on "what else would
you like to see in the Bourne shell"?  If you use either the plain Bourne
shell, or my modified Bourne shell, and have things that you would like to
see added, let me know. If you have written to me and I have responded, then
I still have your ideas. If you wrote to me and I have not, then I probably
never got your mail.

So, if you have ideas for features for the shell that are not listed in
any of what I have done, or am about to do, let me hear from you! If what
you have in mind is at all reasonable for me to do, I will attempt it.

sh users of the world, unite! :-)
-- 
Arnold Robbins
CSNET:	arnold at gatech	ARPA:	arnold%gatech.csnet at csnet-relay.arpa
UUCP:	{ akgua, allegra, hplabs, ihnp4, seismo, ut-sally }!gatech!arnold

Real Unix hackers disdain wimpy languages like C and AWK in favor of /bin/sh.



More information about the Comp.unix.wizards mailing list