home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume1 / bourne / part1 / README.gt.sh < prev    next >
Encoding:
Text File  |  1986-11-30  |  6.9 KB  |  175 lines

  1. README.gt.sh --- README file for Georgia Tech mods to the shell
  2.  
  3. This and the following eight postings should be all you need to add the
  4. following features to the Bourne shell:
  5.  
  6. 1.  BSD style job control on Berkeley Systems. Code to outwit symbolic
  7.     links for shells which have 'pwd' built in.  Also code to print a
  8.     resource usage summary after every command on BSD systems.  These are
  9.     courtesy of the folks at BRL, who gave me permission to post their
  10.     code.
  11.  
  12. 2.  The ability to catch Control-D's, and force you to use "exit", also
  13.     courtesy of BRL.  This will work whether or not you are on a BSD system.
  14.  
  15. 3.  The <> I/O redirecter is now documented, and also works (courtesy of
  16.     ihnp4!trwrb!lcc!brian's recent posting in net.unix-wizards).
  17.  
  18. 4.  The shell parameter $+ gives you the parent process id of the shell.
  19.     It will track the value of the getppid() system call.
  20.  
  21. 5.  The shell will read in $HOME/.shrc on startup, if that file exists.
  22.     This file is read *after* /etc/profile and $HOME/.profile (unlike the
  23.     csh, which readc ~/.cshrc before ~/.login).
  24.  
  25. 6.  The ~ and ~person notation is understood, both for command line arguments,
  26.     and in the PATH and CDPATH shell variables.
  27.  
  28. 7.  Special sequences in PS1 (the shell's prompt string) will print useful
  29.     info at the prompt.  Currently, you can get or all or some or none of:
  30.     the time of day
  31.     your current directory (if the shell has pwd is built in)
  32.     your machine's hostname
  33.     your login name
  34.     the current 'event' number for the ...
  35.  
  36. 8.  History mechanism.  The history mechanism is powerful, yet easy to use.
  37.     Although different from the csh's, it is somewhat more general and
  38.     orthogonal.  The shell will save history across login sessions,
  39.     automatically restoring on login, and saving on exit or on the exec builtin.
  40.  
  41. On a Pyramid, the shell has some additional capabilities:
  42.  
  43. 9.  The 'att', 'ucb' and 'universe' commands are built in.
  44.  
  45. 10. The $UNIVERSE shell variable tracks the current universe.
  46.  
  47. 11. An additional sequence for the prompt to print the current universe.
  48.  
  49. *****************
  50.  
  51. I am posting diffs for the versions of the Bourne shell listed below.
  52. Here are the instructions for setting up the makefile for each shell,
  53. depending on your target machine and OS.  For all versions, you will need
  54. the files history.c and homedir.c; these have been added to the makefile,
  55. but will only be posted once.
  56.  
  57. It will help if you have the 'patch' program.  It was just reposted around
  58. the middle of May, 1985 (Version 1.3). If you don't have it, someone at your
  59. site or someone you know probably does.
  60.  
  61. First, unshar this article.  You wil have the following files:
  62.  
  63. README.gt.sh        # this file
  64. Bugs            # some known bugs in what I've added
  65. signal.c        # courtesy of BRL
  66. ulimit.c        # courtesy of BRL
  67. jobs.c            # courtesy of BRL
  68. homedir.c
  69. history.c
  70. sample.shrc
  71. aliases.sh
  72.  
  73. Next, make a new directory, and copy the source for the version of the shell
  74. that you are going to modify, into it.
  75. Copy the *unformatted* man page for that shell into the directory also.
  76. Move history.c and homedir.c into the directory.
  77.  
  78. Find which version of the shell you have, and follow the supplementary
  79. instructions below.
  80.  
  81. 1. The Berkeley /bin/sh as distributed with 4.2, for 4.2BSD.
  82.     Add the files signal.c and jobs.c to the directory.
  83.     Get parts 2, 3 and 4, and run patch on them.
  84.     Run make.
  85.  
  86.     On a Pyramid, follow the previous paragraph but don't run make yet.
  87.     First, make sure you are in the 'ucb' universe.
  88.     Remove all references to signal.c and signal.o from the makefile.
  89.     Now run make.
  90.  
  91. 2. The System V Release 2 shell as distributed from ATT (for the vax).
  92.     On System V systems, the job stuff is conditionally compiled in.
  93.     Get parts 5, 6, and 7, and run patch on them.
  94.     Remove the -DJOBS and all references to signal.c, ulimit.c,
  95.     jobs.c, and their .o files, from the makefile (sh.mk).
  96.     Run make (make -f sh.mk).
  97.     The sh.1 file will need editing to remove any reference to the 'J'
  98.     flag, the 'I' flag, and to all the job control features.
  99.  
  100.     On BSD systems, copy signal.c, ulimit.c, and jobs.c into the directory.
  101.     Get parts 5, 6, and 7, and run patch on them.
  102.     Run make. (make -f sh.mk)
  103.  
  104.     On a Pyramid, copy ulimit.c, and jobs.c into the directory.
  105.     Run patch.  Remove signal.o and signal.c from the makefile,
  106.     and the testing for u370 for xec.c. Be sure to be in the ucb
  107.     universe, and then run make. (make -f sh.mk)
  108.  
  109. 3. The System V Release 2 shell as modified at BRL, for BRL Unix.
  110.     Get parts 8 and 9, and run patch on them.
  111.  
  112.     There are two ways to compile this version under BRL Unix.
  113.  
  114.     A. Use the standard BSD make and cc. In this case, all you will need
  115.        is history.c and homedir.c.  Run make.
  116.  
  117.     B. Use the System V emulation, /usr/5bin/make and /usr/5bin/cc.
  118.        In this case, make sure your PATH is set properly. Remove the
  119.        -DBSD from the makefile, and also any references to signal.c,
  120.        and ulimit.c, and their .o files.  Now run /usr/5bin/make.
  121.     
  122.     On a Pyramid, run patch.  Edit the makefile to exclude signal.c
  123.     and signal.o.  Be sure to be in the ucb universe, and then run make.
  124.  
  125. **********
  126.  
  127. Aliases.sh is a bunch of useful shell functions --- only of value for one
  128. or the other of the System V Release 2 Versions of the shell.
  129.  
  130. Sample.shrc is a sample .shrc file.  In particular, it gives you some
  131. compatibility with the Korn shell.  It sets PPID=$+, and if the ENV
  132. environment variable is set to a file name, it will source that file
  133. (that is how the ksh does ~/.shrc).
  134.  
  135. If you want job control to be turned on automatically (on a BSD system),
  136. add the line
  137.     set -J
  138. to /etc/profile (or /usr/5lib/profile, depending).  This will turn job
  139. control on for login shells.
  140.  
  141. ***************************************
  142.  
  143. I have tested the shells on the following systems:
  144.  
  145.         Vax (BRL Unix) |  Pyramid  | 3B2 (S5R2)  | 3B20A (S5R2)
  146. BSD shell        x         x
  147. S5R2 shell        x         x        x        x
  148. BRL/S5R2 shell        x         x        x
  149.  
  150. As should be clear from the above table, I have only had access to four
  151. different kinds of machines.  If you are running on some other kind of
  152. hardware, and/or another flavor of Unix (V7, Xenix, Perkin Elmer, whatever),
  153. and you successfully add these mods to the shell, please let me know.  Also
  154. send me any diff listings you may have had to generate.  I am particularly
  155. interested to know if it will still fit on a PDP-11.
  156.  
  157. ***************************************
  158.  
  159. Please don't send me any flames to the effect "You should use the C-shell".
  160. Here is a case where I can have my cake and eat it too, and this should be
  161. a big win for people who only have System V and don't have the ksh.
  162.  
  163. I hope that these modifications to the shell help to meet a need out there
  164. in the real world.  If you find any bugs, please let me know.
  165.  
  166. Arnold Robbins
  167. CSNET:    arnold@gatech    ARPA:    arnold%gatech.csnet@csnet-relay.arpa
  168. UUCP:    { akgua, allegra, hplabs, ihnp4, seismo, ut-sally }!gatech!arnold
  169.  
  170. School of Information and Computer Science
  171. Georgia Institute of Technology
  172. 225 North Avenue, N.W.
  173. Atlanta, Georgia  30332
  174. (404) 894-3658
  175.