Document set [{+|-}{e|x|xe|ex}] [<name> <value>]

This commit is contained in:
David Sidrane 2017-04-05 18:28:54 -06:00 committed by Gregory Nutt
parent 18518eae06
commit 0de787b558
1 changed files with 50 additions and 3 deletions

View File

@ -8,7 +8,7 @@
<tr align="center" bgcolor="#e4e4e4">
<td>
<h1><big><font color="#3c34ec"><i>NuttShell (NSH)</i></font></big></h1>
<p>Last Updated: February 5, 2017</p>
<p>Last Updated: April 5, 2017</p>
</td>
</tr>
</table>
@ -2708,11 +2708,13 @@ nsh&gt;
<p><b>Command Syntax:</b></p>
<ul><pre>
set &lt;name&gt; &lt;value&gt;
set [{+|-}{e|x|xe|ex}] [&lt;name&gt; &lt;value&gt;]
</pre></ul>
<p>
<b>Synopsis</b>.
Set the environment variable <code>&lt;name&gt;</code> to the string <code>&lt;value&gt;</code>.
Set the environment variable <code>&lt;name&gt;</code> to the string <code>&lt;value&gt;</code> and or set NSH
parser control options. For example,
For example,
</p>
<ul><pre>
@ -2724,6 +2726,51 @@ foovalue
nsh&gt;
</pre></ul>
<p>
Set the 'exit on error control' and/or 'print a trace' of commands when parsing
scripts in NSH. The settinngs are in effect from the point of exection, until
they are changed again, or in the case of the init script, the settings are
returned to the default settings when it exits. Included child scripts will run
with the parents settings and changes made in the child script will effect the
parent on return.
</p>
<p>
Use 'set -e' to enable and 'set +e' to disable (ignore) the exit condition on commands.
The default is -e. Errors cause script to exit.
</p>
<p>
Use 'set -x' to enable and 'set +x' to disable (silence) printing a trace of the script
commands as they are ececuted.
The default is +x. No printing of a trace of script commands as they are executed.
</p>
Example 1 - no exit on command not found
<ul><pre>
set +e
notacommand
</pre></ul>
Example 2 - will exit on command not found
<ul><pre>
set -e
notacommand
</pre></ul>
Example 3 - will exit on command not found, and print a trace of the script commmands
<ul><pre>
set -ex
</pre></ul>
Example 4 - will exit on command not found, and print a trace of the script commmands
and set foobar to foovalue.
<ul><pre>
set -ex foobar foovalue
nsh> echo $foobar
foovalue
</pre></ul>
<table width ="100%">
<tr bgcolor="#e4e4e4">
<td>