summaryrefslogtreecommitdiff
path: root/doc/foreground.html
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2015-02-19 04:13:20 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2015-02-19 04:13:20 +0000
commite1fe79a9e705e3cab8f632cdbe8e1774cdef2761 (patch)
treefcf1e195e4025ca14b7caea13c0da41fca15ea97 /doc/foreground.html
parentc73a41da14650d93801a59b85757a73741be986f (diff)
downloadexecline-e1fe79a9e705e3cab8f632cdbe8e1774cdef2761.tar.xz
- exit code overhaul: forx, forbacktickx, loopwhilex, if, ifelse, ifte,v2.1.0.0
ifthenelse - new -o option to forx, forbacktickx, loopwhilex - documentation updated - version: rc for 2.1.0.0
Diffstat (limited to 'doc/foreground.html')
-rw-r--r--doc/foreground.html9
1 files changed, 8 insertions, 1 deletions
diff --git a/doc/foreground.html b/doc/foreground.html
index a2a465f..c0928e9 100644
--- a/doc/foreground.html
+++ b/doc/foreground.html
@@ -37,7 +37,8 @@
executes it, then waits for it to complete. </li>
<li> <tt>foreground</tt> sets the <tt>?</tt> environment
variable to the exit code of <em>prog1</em>. If <em>prog1...</em>
-did not exit normally, the <tt>?</tt> value is 111. </li>
+was killed by a signal, the <tt>?</tt> value is 256 plus the signal
+number. </li>
<li> <tt>foreground</tt> then execs into <em>prog2...</em>. </li>
</ul>
@@ -51,6 +52,12 @@ wrap external commands that exit instead of natively supporting the
<li> <tt>foreground <em>prog1...</em> "" <em>prog2...</em></tt> is
equivalent to <tt>sh -c '<em>prog1...</em> ; exec <em>prog2...</em>'</tt>.
</li>
+ <li> 256 and above are not valid exit codes for commands, so when the
+<tt>?</tt> environment variable contains 256 or more, it means that the
+previous command was killed by a signal. There is no ambiguity here, and
+<tt>?</tt> reports exactly what happened to the previous command;
+<tt>foreground</tt> does not exit, so there is no need for
+<a href="exitcodes.html">exit code approximation</a>. </li>
</ul>
</body>