aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/dollarsharp.html46
-rw-r--r--doc/index.html12
-rw-r--r--doc/upgrade.html4
-rw-r--r--doc/wait.html49
4 files changed, 93 insertions, 18 deletions
diff --git a/doc/dollarsharp.html b/doc/dollarsharp.html
new file mode 100644
index 0000000..4643775
--- /dev/null
+++ b/doc/dollarsharp.html
@@ -0,0 +1,46 @@
+<html>
+ <head>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <meta name="color-scheme" content="dark light" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta http-equiv="Content-Language" content="en" />
+ <title>execline: the dollarsharp command</title>
+ <meta name="Description" content="execline: the dollarsharp command" />
+ <meta name="Keywords" content="execline command dollarsharp" />
+ <!-- <link rel="stylesheet" type="text/css" href="//skarnet.org/default.css" /> -->
+</head>
+<body>
+
+<p>
+<a href="index.html">execline</a><br />
+<a href="//skarnet.org/software/">Software</a><br />
+<a href="//skarnet.org/">skarnet.org</a>
+</p>
+
+<h1> The <tt>dollarsharp</tt> program </h1>
+
+<p>
+<tt>dollarsharp</tt> prints the number of arguments it is called with.
+</p>
+
+<h2> Interface </h2>
+
+<pre>
+ dollarsharp [ args ]
+</pre>
+
+<ul>
+ <li> <tt>dollarsharp</tt> reads the number of arguments it is given,
+then prints this number on stdout. </li>
+ <li> It then exits 0. </li>
+
+<h2> Notes </h2>
+
+<ul>
+ <li> A use case for <tt>dollarsharp</tt> is e.g. after calling an
+<a href="elglob.html"><tt>elglob -0</tt></a> command, to check how
+many results the globbing returned. </li>
+</ul>
+
+</body>
+</html>
diff --git a/doc/index.html b/doc/index.html
index 075fcf9..3ed48b7 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -194,6 +194,7 @@ the previous versions of execline and the current one. </li>
<li><a href="elgetopt.html">The <tt>elgetopt</tt> program</a></li>
<li><a href="shift.html">The <tt>shift</tt> program</a></li>
<li><a href="dollarat.html">The <tt>dollarat</tt> program</a></li>
+<li><a href="dollarsharp.html">The <tt>dollarsharp</tt> program</a></li>
</ul>
<p>
(Miscellaneous)
@@ -252,5 +253,16 @@ the execline documentation as a
<a href="//skarnet.org/lists/#skaware">skaware</a> mailing-list. </li>
</ul>
+<h2> Support this work </h2>
+
+<p>
+ If you like this skarnet.org project, you can donate to the author via Liberapay,
+by clicking the following button:
+<script src="https://liberapay.com/skarnet/widgets/button.js"></script>
+<noscript>
+<a href="https://liberapay.com/skarnet/donate"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a>
+</noscript>
+</p>
+
</body>
</html>
diff --git a/doc/upgrade.html b/doc/upgrade.html
index 31de4b9..de3fbf4 100644
--- a/doc/upgrade.html
+++ b/doc/upgrade.html
@@ -27,6 +27,10 @@ been removed, due to POSIX relaxing requirements on intrinsic utilities. </li>
<li> The <a href="cd.html">cd</a> binary is now what was previously <tt>execline-cd</tt>. </li>
<li> The <a href="umask.html">umask</a> binary is now what was previously <tt>posix-umask</tt>,
(without locale support, not that it had much to start with) </li>
+ <li> <a href="loopwhilex"><tt>loopwhilex -x ""</tt></a> now loops forever. The <tt>-n</tt>
+option has been removed. </li>
+ <li> <a href="wait.html"><tt>wait</tt></a> has slightly different options. When given a
+non-empty list of pids, it <em>only</em> waits for these pids and doesn't touch the others. </li>
</ul>
<h2> in 2.9.9.2 </h2>
diff --git a/doc/wait.html b/doc/wait.html
index 44197a0..d38b06a 100644
--- a/doc/wait.html
+++ b/doc/wait.html
@@ -30,7 +30,7 @@
</p>
<pre>
- wait [ -I | -i ] [ -a | -o ] [ -r | -t <em>timeout</em> ] { [ <em>pids...</em> ] } <em>prog...</em>
+ wait [ -a | -o ] [ -u ] [ -t <em>timeout</em> ] { [ <em>pids...</em> ] } <em>prog...</em>
</pre>
<ul>
@@ -40,36 +40,49 @@ and unquotes it. </li>
<li> <tt>wait</tt> waits for every child whose pid is
listed in <em>pids...</em>. If <em>pids...</em> is an
empty list, it waits for every child process it has. </li>
- <li><tt>wait</tt> then execs into <em>prog...</em>. </li>
+ <li> <tt>wait</tt> then execs into <em>prog...</em>. </li>
</ul>
<h2> Options </h2>
<ul>
- <li> <tt>-r</tt>&nbsp;: equivalent to <tt>-t&nbsp;0</tt>. Do not
-pause: only reap processes that are already dead when <tt>wait</tt>
-is invoked. </li>
<li> <tt>-t</tt>&nbsp;<em>timeout</em>&nbsp;: wait for a maximum
of <em>timeout</em> milliseconds. If there still are living processes
among <em>pids...</em> (or among <tt>wait</tt>'s children if
<em>pids...</em> is an empty list), after <em>timeout</em>
-milliseconds, they will not be reaped. </li>
- <li> <tt>-I</tt>&nbsp;: loose. If <tt>wait</tt> times out while
-waiting for children to die, it will still
-exec into <em>prog...</em>. This is the default. </li>
- <li> <tt>-i</tt>&nbsp;: strict. If <tt>wait</tt> times out, it
-will print an error message and exit 99. </li>
+milliseconds, they will not be waited for. In particular, <tt>-t0</tt>
+tells <tt>wait</tt> to perform a single reaping pass on current zombies
+and immediately exec into <em>prog...</em>. </li>
<li> <tt>-o</tt>&nbsp;: wait for <em>one</em> of the listed
<em>pids</em> &mdash; exec into <em>prog</em> as soon as one of the
listed children dies. (If no pid is listed, wait for one child to die.)
-The <tt>!</tt> environment variable will be set to the
-pid that died, and the <tt>?</tt> environment variable will contain an
-<a href="exitcodes.html">approximation</a> of its exit code. If no
-listed child has died before <tt>wait</tt> has to exec (either because
-it timed out or it has no suitable children left), the <tt>?</tt> and
-<tt>!</tt> environment variables are unset. </li>
<li> <tt>-a</tt>&nbsp;: wait for <em>all</em> of the listed <em>pids</em>.
-Do not touch the <tt>!</tt> or <tt>?</tt> variables. This is the default. </li>
+This is the default. </li>
+ <li> <tt>-u</tt>&nbsp;: do not export the result in the environment,
+even if <tt>wait</tt> succeeds. </li>
+</ul>
+
+<h2> Environment variables </h2>
+
+<p>
+ If the <tt>-u</tt> option has been given, <tt>wait</tt> execs into <em>prog...</em>
+with the <tt>!</tt> and <tt>?</tt> environment variables unset. Same thing if an
+error occurred before <tt>wait</tt> could successfully reap a zombie.
+</p>
+
+<p>
+ Otherwise, the <tt>!</tt> environment variable is set to the pid of a reapt zombie,
+and the <tt>?</tt> environment variable is set to its exit code. Here is how <tt>wait</tt>
+decides what pid to report:
+</p>
+
+<ul>
+ <li> If the <tt>-o</tt> option has been given, <tt>!</tt> is set to the pid of <em>the<em>
+one zombie that has just been reapt. </li>
+ <li> Otherwise, if <tt>wait</tt> has been given an empty list of pids (meaning it should
+wait for all of its children), then <tt>!</tt> is set to the pid of the last child it has
+waited for. If there were no children, <tt>!</tt> and <tt>?</tt> are unset. </li>
+ <li> Otherwise, <tt>!</tt> is set to the <em>last</em> pid in the list provided to <tt>wait</tt>. </li>
</ul>
<h2> Notes </h2>