summaryrefslogtreecommitdiff
path: root/nuttx
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-01-17 18:03:23 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-01-17 18:03:23 -0600
commit4f8b0d0a714a7f8302e876e217e8f49e2c5901d5 (patch)
tree15d6fa10198715c62050711a064cce6444d064e1 /nuttx
parente33bd6bd784ba0334beb0481d82416be38fbb54d (diff)
downloadpx4-nuttx-4f8b0d0a714a7f8302e876e217e8f49e2c5901d5.tar.gz
px4-nuttx-4f8b0d0a714a7f8302e876e217e8f49e2c5901d5.tar.bz2
px4-nuttx-4f8b0d0a714a7f8302e876e217e8f49e2c5901d5.zip
NSH: Loosen up if-then-else-fi syntx so that a command can be on the same line as the 'then' and 'else' tokens. This allows, as an example, 'if true; then echo true; else echo false; fi' which is much more bash-like
Diffstat (limited to 'nuttx')
-rw-r--r--nuttx/Documentation/NuttShell.html33
1 files changed, 26 insertions, 7 deletions
diff --git a/nuttx/Documentation/NuttShell.html b/nuttx/Documentation/NuttShell.html
index 603ae759d..2eeed4e67 100644
--- a/nuttx/Documentation/NuttShell.html
+++ b/nuttx/Documentation/NuttShell.html
@@ -618,15 +618,34 @@ fi
<p>
<code>while-do-done</code> and <code>until-do-done</code> looping constructs are also supported.
- These works from the command line but are primarily intended for use within NSH scripts
+ These work from the command line but are primarily intended for use within NSH scripts
(see the <a href="#cmdsh"><code>sh</code></a> command).
- The syntax is as follows:
</p>
-<ul><dl>
- <dt><code>while &lt;test-cmd&gt;; do &lt;cmd-sequence&gt;; done</code></dt>
- <dd>Execute <code>&lt;cmd-sequence&gt;</code> as long as <code>&lt;test-cmd&gt;</code> has an exit status of zero.</dd>
- <dt><code>until &lt;test-cmd&gt;; do &lt;cmd-sequence&gt;; done</code></dt>
- <dd>Execute <code>&lt;cmd-sequence&gt;</code> as long as <code>&lt;test-cmd&gt;</code> has a non-zero exit status.</dd>
+<ul>
+ <li>
+ <p><b><code>while-do-done</code></b>.
+ Execute <code>[sequence of &lt;cmd&gt;]</code> as long as <code>&lt;cmd&gt;</code> has an exit status of zero.
+ The syntax is as follows:
+ <ul><pre>
+while &lt;cmd&gt;
+do
+ [sequence of &lt;cmd&gt;]
+done
+</pre></ul>
+ </p>
+ </li>
+ <li>
+ <p><b><code>until-do-done</code></b>
+ Execute <code>[sequence of &lt;cmd&gt;]</code> as long as <code>&lt;cmd&gt;</code> has a non-zero exit status.
+ The syntax is as follows:
+ <ul><pre>
+while &lt;cmd&gt;
+do
+ [sequence of &lt;cmd&gt;]
+done
+</pre></ul>
+ </p>
+ </li>
</dl></ul>
<table width ="100%">