summaryrefslogtreecommitdiff
path: root/doc/if.html
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2018-03-16 08:18:53 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2018-03-16 08:18:53 +0000
commit77a47b2c5e7c3243743bd8d7594366f498e9cef7 (patch)
treefb807c0b0c20db34f5108df67da6b4d64e5bc8e6 /doc/if.html
parent3fde941ae33bd70edf015b3c72997aef703ebf6d (diff)
downloadexecline-77a47b2c5e7c3243743bd8d7594366f498e9cef7.tar.xz
More modifications, and doc change
Diffstat (limited to 'doc/if.html')
-rw-r--r--doc/if.html28
1 files changed, 14 insertions, 14 deletions
diff --git a/doc/if.html b/doc/if.html
index 700ee59..09f944a 100644
--- a/doc/if.html
+++ b/doc/if.html
@@ -3,9 +3,9 @@
<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 if command</title>
- <meta name="Description" content="execline: the if command" />
- <meta name="Keywords" content="execline command if" />
+ <title>execline: the &amp;&amp; command</title>
+ <meta name="Description" content="execline: the &amp;&amp; command" />
+ <meta name="Keywords" content="execline command &amp;&amp;" />
<!-- <link rel="stylesheet" type="text/css" href="//skarnet.org/default.css" /> -->
</head>
<body>
@@ -16,10 +16,10 @@
<a href="//skarnet.org/">skarnet.org</a>
</p>
-<h1> The <tt>if</tt> program </h1>
+<h1> The <tt>&amp;&amp;</tt> program </h1>
<p>
-<tt>if</tt> performs conditional execution.
+<tt>&amp;&amp;</tt> performs conditional execution.
</p>
<h2> Interface </h2>
@@ -29,18 +29,18 @@
</p>
<pre>
- if [ -X ] [ -n ] [ -t | -x <em>exitcode</em> ] { <em>prog1...</em> } <em>prog2...</em>
+ &amp;&amp; [ -X ] [ -n ] [ -t | -x <em>exitcode</em> ] { <em>prog1...</em> } <em>prog2...</em>
</pre>
<ul>
- <li> <tt>if</tt> reads <em>prog1...</em> in a
+ <li> <tt>&amp;&amp;</tt> reads <em>prog1...</em> in a
<a href="el_semicolon.html">block</a>. It forks and executes it,
then waits for it to complete. </li>
- <li> If <em>prog1</em> crashes, <tt>if</tt> prints an error message
+ <li> If <em>prog1</em> crashes, <tt>&amp;&amp;</tt> prints an error message
then exits 128 plus the number of the signal that killed <em>prog1</em>. </li>
<li> If <em>prog1</em> exits a non-zero status,
-<tt>if</tt> exits 1.</li>
- <li> Else <tt>if</tt> execs into <em>prog2</em>. </li>
+<tt>&amp;&amp;</tt> exits 1.</li>
+ <li> Else <tt>&amp;&amp;</tt> execs into <em>prog2</em>. </li>
</ul>
<h2> Options </h2>
@@ -56,12 +56,12 @@ This is equivalent to <tt>-x 0</tt>. </li>
<h2> Notes </h2>
<ul>
- <li> <tt>if</tt> will exit if <em>prog1...</em> exits false. To use it in
+ <li> <tt>&amp;&amp;</tt> will exit if <em>prog1...</em> exits false. To use it in
an execline script that must run <em>prog3...</em> no matter the result of
-the test, use a <tt>foreground</tt> wrapper:
-<pre> foreground { if { <em>prog1...</em> } <em>prog2...</em> } <em>prog3...</em> </pre>
+the test, use a <tt>&semi;</tt> wrapper:
+<pre> &semi; { &amp;&amp; { <em>prog1...</em> } <em>prog2...</em> } <em>prog3...</em> </pre>
(in <a href="execlineb.html">execlineb</a> syntax) </li>
- <li> <tt>if <em>prog1...</em> "" <em>prog2...</em></tt> is
+ <li> <tt>&amp;&amp; <em>prog1...</em> "" <em>prog2...</em></tt> is
equivalent to <tt>sh -c '<em>prog1...</em> && exec <em>prog2...</em>'</tt>. </li>
</ul>