summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/backtick.html8
-rw-r--r--doc/index.html3
-rw-r--r--doc/upgrade.html3
-rw-r--r--doc/withstdinas.html67
4 files changed, 76 insertions, 5 deletions
diff --git a/doc/backtick.html b/doc/backtick.html
index df351f2..6aa2f01 100644
--- a/doc/backtick.html
+++ b/doc/backtick.html
@@ -19,8 +19,8 @@
<h1> The <tt>backtick</tt> program </h1>
<p>
-<tt>backtick</tt> runs a program and uses its output as the argument of
-another program.
+<tt>backtick</tt> runs a program and stores its output in an
+environment variable, then executes another program.
</p>
<h2> Interface </h2>
@@ -47,8 +47,8 @@ output as a value. </li>
<ul>
<li> <tt>-i</tt>&nbsp;: insist. If <em>prog1</em> crashes or exits non-zero,
-<tt>backtick</tt> exits with the same exit code (or 111 if <em>prog1</em>
-crashed). </li>
+<tt>backtick</tt> exits with an
+<a href="exitcodes.html">approximation</a> of the same exit code. </li>
<li> <tt>-D&nbsp;<em>default</em></tt>&nbsp;: default value. If
<em>prog1</em> crashes or exits non-zero, <em>default</em> is used as
<em>variable</em>'s value. If neither the <tt>-i</tt> nor the <tt>-D</tt>
diff --git a/doc/index.html b/doc/index.html
index 9772ccb..1b61375 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -131,13 +131,13 @@ to your installation: the shebang lines for your system might be something like
<li><a href="redirfd.html">The <tt>redirfd</tt> program</a></li>
<li><a href="piperw.html">The <tt>piperw</tt> program</a></li>
<li><a href="heredoc.html">The <tt>heredoc</tt> program</a></li>
-<li><a href="pipeline.html">The <tt>pipeline</tt> program</a></li>
<li><a href="wait.html">The <tt>wait</tt> program</a></li>
<li><a href="getpid.html">The <tt>getpid</tt> program</a></li>
<li><a href="exec.html">The <tt>exec</tt> program</a></li>
<li><a href="tryexec.html">The <tt>tryexec</tt> program</a></li>
<li><a href="exit.html">The <tt>exit</tt> program</a></li>
<li><a href="trap.html">The <tt>trap</tt> program</a></li>
+<li><a href="withstdinas.html">The <tt>withstdinas</tt> program</a></li>
</ul>
<p>
(<a href="el_semicolon.html">Basic block management</a>)
@@ -150,6 +150,7 @@ to your installation: the shebang lines for your system might be something like
<li><a href="ifte.html">The <tt>ifte</tt> program</a></li>
<li><a href="ifthenelse.html">The <tt>ifthenelse</tt> program</a></li>
<li><a href="backtick.html">The <tt>backtick</tt> program</a></li>
+<li><a href="pipeline.html">The <tt>pipeline</tt> program</a></li>
<li><a href="runblock.html">The <tt>runblock</tt> program</a></li>
</ul>
<p>
diff --git a/doc/upgrade.html b/doc/upgrade.html
index 11ecd0a..6013a41 100644
--- a/doc/upgrade.html
+++ b/doc/upgrade.html
@@ -22,6 +22,9 @@
<ul>
<li> New <tt>EXECLINE_BLOCK_END_STRING</tt> and <tt>EXECLINE_BLOCK_QUOTE_STRING</tt> macros </li>
+ <li> New command: <a href="withstdinas.html">withstdinas</a>. It's a simplification
+of <a href="backtick.html">backtick</a>, which is now implemented as a combination of
+<a href="pipeline.html">pipeline</a> and <a href="withstdinas.html">withstdinas</a>. </li>
</ul>
<h2> in 2.1.3.1 </h2>
diff --git a/doc/withstdinas.html b/doc/withstdinas.html
new file mode 100644
index 0000000..29ad1b6
--- /dev/null
+++ b/doc/withstdinas.html
@@ -0,0 +1,67 @@
+<html>
+ <head>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta http-equiv="Content-Language" content="en" />
+ <title>execline: the withstdinas command</title>
+ <meta name="Description" content="execline: the withstdinas command" />
+ <meta name="Keywords" content="execline command withstdinas" />
+ <!-- <link rel="stylesheet" type="text/css" href="http://skarnet.org/default.css" /> -->
+</head>
+<body>
+
+<p>
+<a href="index.html">execline</a><br />
+<a href="http://skarnet.org/software/">Software</a><br />
+<a href="http://skarnet.org/">skarnet.org</a>
+</p>
+
+<h1> The <tt>withstdinas</tt> program </h1>
+
+<p>
+<tt>withstdinas</tt> reads the entirety of its standard input in an
+environment variable, and runs another program with that additional
+environment variable.
+</p>
+
+<h2> Interface </h2>
+
+<p>
+ In an <a href="execlineb.html">execlineb</a> script:
+</p>
+
+<pre>
+ withstdinas [ -i | -D <em>default</em> ] [ -n ] <em>variable</em> <em>prog...</em>
+</pre>
+
+<ul>
+ <li> <tt>withstdinas</tt> reads its stdin until EOF. </li>
+ <li> It then execs into <em>prog...</em>, with
+<em>variable</em> added to the environment; the value of
+<em>variable</em> is what was read on stdin. </li>
+</ul>
+
+<h2> Options </h2>
+
+<ul>
+ <li> <tt>-i</tt>&nbsp;: insist. If the data on stdin is invalid as
+an environment variable, for instance if it contains a null
+character, <tt>withstdinas</tt> exits 1. </li>
+ <li> <tt>-D&nbsp;<em>default</em></tt>&nbsp;: default value.
+If the data on stdin is invalid, <em>default</em> is used as
+<em>variable</em>'s value. If neither the <tt>-i</tt> nor the <tt>-D</tt>
+option have been given, <tt>withstdinas</tt> execs into
+<em>prog...</em> with <em>variable</em> containing whatever value could be read on stdin,
+cut before the first null character. </li>
+ <li> <tt>-n</tt>&nbsp;: chomp an ending newline off stdin. </li>
+</ul>
+
+<h2> Notes </h2>
+
+<ul>
+ <li> You can start <em>prog...</em> with "import -u <em>variable</em>"
+to perform variable substitution. </li>
+</ul>
+
+</body>
+</html>