home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume10 / sxt-sh-jobs / part02 / sh.1.Diff < prev    next >
Encoding:
Text File  |  1987-06-22  |  8.7 KB  |  301 lines

  1. *** /cs/simon/src/util/sh.sysV/sh.1    Thu Feb 19 19:12:25 1987
  2. --- ../shdiff-sources/sh.1    Thu Feb 19 18:12:00 1987
  3. ***************
  4. *** 31,36
  5.   .TH SH 1
  6.   .SH NAME
  7.   sh, rsh \- shell, the standard/restricted command programming language
  8.   .SH SYNOPSIS
  9.   .B sh
  10.   [
  11.  
  12. --- 31,37 -----
  13.   .TH SH 1
  14.   .SH NAME
  15.   sh, rsh \- shell, the standard/restricted command programming language
  16. + (job-control version)
  17.   .SH SYNOPSIS
  18.   .B sh
  19.   [
  20. ***************
  21. *** 552,557
  22.   below) for this name.
  23.   If it is found and there is an 'r' in the file name part of its value, the
  24.   shell becomes a restricted shell.
  25.   .PD
  26.   .RE
  27.   .PP
  28.  
  29. --- 553,578 -----
  30.   below) for this name.
  31.   If it is found and there is an 'r' in the file name part of its value, the
  32.   shell becomes a restricted shell.
  33. + .TP
  34. + .B
  35. + .SM NOTIFY
  36. + If this is set, then you will receive asynchronous notification of the
  37. + termination of background jobs \- it is equivalent to an automatic
  38. + \f2notify\^\fP being applied to all jobs.
  39. + .TP
  40. + .B
  41. + .SM REALTTY
  42. + If job-control is being used, this parameter will hold the name of the
  43. + real (physical) terminal you are logged in on; the entry in \f2utmp\^\fP
  44. + is reset to the name of the \f2sxt\^\fP device you are using.
  45. + It is automatically read-only and exported.
  46. + .TP
  47. + .B
  48. + .SM SXT_CONTROL
  49. + This may be available in sub-processes in order to do their own
  50. + job-control. The parameter holds a number on which \f2ioctl\^\fP calls
  51. + can be done. To suspend itself, a process need only execute the
  52. + \f2\s-1SXTIOCSWTCH\s+1\fP ioctl with a channel-parameter of zero.
  53.   .PD
  54.   .RE
  55.   .PP
  56. ***************
  57. *** 557,562
  58.   .PP
  59.   The shell gives default values to
  60.   \f3\s-1PATH\s+1\fP, \f3\s-1PS1\s+1\fP, \f3\s-1PS2\s+1\fP, \f3\s-1MAILCHECK\s+1\fP and \f3\s-1IFS\s+1\fP.
  61.   .SM
  62.   .B HOME
  63.   and
  64.  
  65. --- 578,585 -----
  66.   .PP
  67.   The shell gives default values to
  68.   \f3\s-1PATH\s+1\fP, \f3\s-1PS1\s+1\fP, \f3\s-1PS2\s+1\fP, \f3\s-1MAILCHECK\s+1\fP and \f3\s-1IFS\s+1\fP.
  69. + If job-control is being used, it will also set some of
  70. + \f3\s-1REALTTY\s+1\fP and \f3\s-1SXT_CONTROL\s+1\fP.
  71.   .SM
  72.   .B HOME
  73.   and
  74. ***************
  75. *** 880,885
  76.   the
  77.   .B trap
  78.   command below).
  79.   .SS Execution
  80.   Each time a command is executed, the above substitutions are
  81.   carried out.
  82.  
  83. --- 903,940 -----
  84.   the
  85.   .B trap
  86.   command below).
  87. + .SS "Job Control"
  88. + Whenever a command is executed which results in the shell forking off
  89. + a subprocess, this subprocess is entered in a table of "jobs". Individual
  90. + jobs may then be manipulated using special job-control commands which
  91. + are built-ins in the shell.
  92. + The command \f3fg\fP brings a job into the foreground (from either the
  93. + background or "limbo"), \f3bg\fP resumes a blocked job in the background,
  94. + \f3jobs\fP lists the jobs-table, \f3notify\fP allows a job to give
  95. + asynchronous notification if it terminates from the background, 
  96. + \f3stop\fP allows a job to be blocked from doing any output when it is
  97. + not in the foreground (see \f3loblk\fP in \f2stty\^\fP(1)), and
  98. + \f3sxt1\fP allows escape from the job-control regime if this becomes
  99. + necessary.
  100. + The \f3kill\fP command is now a shell built-in and can take
  101. + job-specifiers as parameters, as well as the usual process-id numbers.
  102. + .PP
  103. + All of these commands use job-specifiers to name jobs. A job-specifier
  104. + consists of a percent-sign (\f3%\fP) followed by some unique string.
  105. + If the string does not name a unique job, this is considered to be
  106. + an error (which should perhaps not be the case \- "wildcard" globbing
  107. + of job-specifiers would be nice).
  108. + The following strings are recognized:
  109. + .RS
  110. + .nf
  111. + %\f2n\^\fP \| the job numbered \f2n\^\fP
  112. + %+ \| the current job
  113. + %- \| the previous job
  114. + %% \| a symnonym for %+
  115. + %\f2name\^\fP \| the job whose command-name starts with \f2name^\fP
  116. + %?\f2string\^\fP \| the job whose name contains the named \f2string\^\fP
  117. + .fi
  118. + .RE
  119.   .SS Execution
  120.   Each time a command is executed, the above substitutions are
  121.   carried out.
  122. ***************
  123. *** 969,974
  124.   is used to find the directory containing
  125.   .IR file .
  126.   .TP
  127.   \f3break\fP \*(OK \f2n\^\fP \*(CK
  128.   Exit from the enclosing \f3for\fP or
  129.   .B while
  130.  
  131. --- 1024,1032 -----
  132.   is used to find the directory containing
  133.   .IR file .
  134.   .TP
  135. + \f3bg\fP \*(OK \f2%job\^\fP \*CK
  136. + Resume the named (or "current") job in the background.
  137. + .TP
  138.   \f3break\fP \*(OK \f2n\^\fP \*(CK
  139.   Exit from the enclosing \f3for\fP or
  140.   .B while
  141. ***************
  142. *** 1068,1073
  143.   .I not
  144.   be exported.
  145.   .TP
  146.   \f3hash\fP \*(OK \f3\-r\fP \*(CK \*(OK \fIname\^\fP .\|.\|. \*(CK
  147.   For each 
  148.   .IR name\^ ,
  149.  
  150. --- 1126,1134 -----
  151.   .I not
  152.   be exported.
  153.   .TP
  154. + \f3fg\fP \*(OK \f2%job\^\fP \*(CK
  155. + Resume the named (or default) job in the foreground.
  156. + .TP
  157.   \f3hash\fP \*(OK \f3\-r\fP \*(CK \*(OK \fIname\^\fP .\|.\|. \*(CK
  158.   For each 
  159.   .IR name\^ ,
  160. ***************
  161. *** 1088,1093
  162.   adjacent to the \f2hits\fR information.
  163.   \f2Cost\fR will be incremented when the recalculation is done.
  164.   .TP
  165.   \f3newgrp\fP \*(OK \f2arg\^\fP .\|.\|. \*(CK
  166.   Equivalent to
  167.   .BI "exec newgrp" " arg\^"
  168.  
  169. --- 1149,1178 -----
  170.   adjacent to the \f2hits\fR information.
  171.   \f2Cost\fR will be incremented when the recalculation is done.
  172.   .TP
  173. + \f3jobs\fP \*(OK \f3-l\^\fP \*(CK
  174. + List all currently active (running or blocked) jobs.
  175. + Each job will be listed by giving its job-number within square
  176. + brackets, followed by a identifying character, followed
  177. + by a status-word (either "Blocked" or "Running"), followed by a the name of
  178. + the command. If the \f3-l\fP option is used, then a list of process-id
  179. + numbers associated with that job is printed too.
  180. + .br
  181. + The identifying-character will be one of <blank>, \f3+\fP or \f3-\fP.
  182. + The job "%+" is the current "default job", wheras "%-" is the previous
  183. + current job.
  184. + .br
  185. + The status word "Running" means that it is a pure background process,
  186. + "Blocked" means that it is possibly executing but will block as soon
  187. + as it tries to do any input (or possibly output \- see the \f3loblk\fP
  188. + option to \f2stty\^\fP or the \f3stop\fP command) from the terminal.
  189. + A physically blocked job will have either "(tty input)" or "(tty output)"
  190. + following the word "Blocked".
  191. + .TP
  192. + \f3kill\fP \*(OK \f2-sig\^\fP \*(CK \f2{process,%job} ...\^\fP
  193. + Kill the named processes or jobs by sending the named signal. If
  194. + no signal is named, then \f2SIGTERM\^\fP is sent \- signal 15.
  195. + It is not possible to give signal-name mnemonics to specify signal numbers.
  196. + .TP
  197.   \f3newgrp\fP \*(OK \f2arg\^\fP .\|.\|. \*(CK
  198.   Equivalent to
  199.   .BI "exec newgrp" " arg\^"
  200. ***************
  201. *** 1096,1101
  202.   .IR newgrp (1)
  203.   for usage and description.
  204.   .TP
  205.   \f3pwd\fP
  206.   Print the current working directory.
  207.   See
  208.  
  209. --- 1181,1190 -----
  210.   .IR newgrp (1)
  211.   for usage and description.
  212.   .TP
  213. + \f3notify\fP \*(OK \f2%job\^\fP \*(CK
  214. + Arrange for asynchronous notification when background jobs terminate.
  215. + If no job is given, then all subsequent jobs will asynchronously notify.
  216. + .TP
  217.   \f3pwd\fP
  218.   Print the current working directory.
  219.   See
  220. ***************
  221. *** 1208,1213
  222.   .I n\^
  223.   is not given, it is assumed to be 1.
  224.   .TP
  225.   \f3test\fP
  226.   .br
  227.   Evaluate conditional expressions. See
  228.  
  229. --- 1297,1314 -----
  230.   .I n\^
  231.   is not given, it is assumed to be 1.
  232.   .TP
  233. + \f3stop\fP \*(OK \f2%job\^\fP \*(CK
  234. + Stop a given (or the "current") running background job. A job that is
  235. + "stopped" will continue to execute until it tries to do input or output
  236. + from the terminal, and it will block as soon as this occurs.
  237. + .TP
  238. + \f3sxt1 \f2command args ...\^\fP
  239. + Execute a command without using job-control. This is useful for commands
  240. + which rely on being able to find out the name of their terminal from the
  241. + \f2utmp\^\fP file \- such as \f2who\^\fP, \f2mesg\^\fP, \f2tty\^\fP
  242. + or quite a few others. This is only necessary because of the simplisitic
  243. + nature of \f2utmp\^\fP.
  244. + .TP
  245.   \f3test\fP
  246.   .br
  247.   Evaluate conditional expressions. See
  248. ***************
  249. *** 1476,1481
  250.   exec(2),
  251.   fork(2),
  252.   pipe(2),
  253.   signal(2),
  254.   ulimit(2),
  255.   umask(2),
  256.  
  257. --- 1577,1583 -----
  258.   exec(2),
  259.   fork(2),
  260.   pipe(2),
  261. + setpgrp(2),
  262.   signal(2),
  263.   ulimit(2),
  264.   umask(2),
  265. ***************
  266. *** 1482,1488
  267.   wait(2),
  268.   a.out(4),
  269.   profile(4),
  270. ! environ(5) in the
  271.   \f2\s-1UNIX\s+1 System Programmer Reference Manual\fR.
  272.   .SH CAVEATS
  273.   .PP
  274.  
  275. --- 1584,1591 -----
  276.   wait(2),
  277.   a.out(4),
  278.   profile(4),
  279. ! environ(5),
  280. ! sxt(7) in the
  281.   \f2\s-1UNIX\s+1 System Programmer Reference Manual\fR.
  282.   .SH CAVEATS
  283.   .PP
  284. ***************
  285. *** 1502,1504
  286.   .B cd\^
  287.   command with a full path name
  288.   to correct this situation.
  289.  
  290. --- 1605,1614 -----
  291.   .B cd\^
  292.   command with a full path name
  293.   to correct this situation.
  294. + .SH ADDITIONS
  295. + .PP
  296. + This version of the shell has additional job-control features 
  297. + for the \f2sxt\^\fP(7) driver,
  298. + added by Simon Brown at the University of Edinburgh.
  299. + (Send any bug reports to \f3simon@its63b.edinburgh.ac.uk\fP
  300. + or \f3seismo!mcvax!ukc!its63b!simon\fP).
  301.