diff --git a/Documentation/NuttShell.html b/Documentation/NuttShell.html index 484db3ac0c5..90fa5075d42 100644 --- a/Documentation/NuttShell.html +++ b/Documentation/NuttShell.html @@ -8,7 +8,7 @@
Last Updated: June 22, 2018
+Last Updated: August 11, 2018
CONFIG_NSH_CMDPARMS.
- If selected, then the output from commands, from file applications, and from NSH built-in commands can be used as arguments to other commands.
- The entity to be executed is identified by enclosing the command line in back quotes.
+
+ CONFIG_NSH_CMDPARMS.
+ If selected, then the output from commands, from file applications, and from NSH built-in commands can be used as arguments to other commands.
+ The entity to be executed is identified by enclosing the command line in back quotes.
For example,
-
-
+ +
set FOO `myprogram $BAR`
- Will execute the program named myprogram passing it the value of the environment variable BAR.
- The value of the environment variable FOO is then set output of myprogram on stdout.
+
+ Will execute the program named myprogram passing it the value of the environment variable BAR.
+ The value of the environment variable FOO is then set output of myprogram on stdout.
+
CONFIG_NSH_ARGCAT.
- Support concatenation of strings with environment variables or command output. For example:
+
+ CONFIG_NSH_ARGCAT.
+ Support concatenation of strings with environment variables or command output. For example:
+
set FOO XYZ
set BAR 123
set FOOBAR ABC_${FOO}_${BAR}
- would set the environment variable FOO to XYZ, BAR to 123 and FOOBAR to ABC_XYZ_123.
- If CONFIG_NSH_ARGCAT is not selected, then a slightly smaller FLASH footprint results but then also only simple environment variables like $FOO can be used on the command line.
+
+ would set the environment variable FOO to XYZ, BAR to 123 and FOOBAR to ABC_XYZ_123.
+ If CONFIG_NSH_ARGCAT is not selected, then a slightly smaller FLASH footprint results but then also only simple environment variables like $FOO can be used on the command line.
+
+ CONFIG_NSH_QUOTE.
+ Enables back-slash quoting of certain characters within the command.
+ This option is useful for the case where an NSH script is used to dynamically generate a new NSH script.
+ In that case, commands must be treated as simple text strings without interpretation of any special characters.
+ Special characters such as $, `, ", and others must be retained intact as part of the test string.
+ This option is currently only available is CONFIG_NSH_ARGCAT is also selected.
+
sh command). The syntax is as follows:
-if <cmd> +if [!] <cmd> then [sequence of <cmd>] else @@ -910,10 +926,10 @@ fi
while-do-done.
- Execute [sequence of <cmd>] as long as <cmd> has an exit status of zero.
+ Execute [sequence of <cmd>] as long as <cmd> has an exit status of zero (or non-zero if inverted with !).
The syntax is as follows:
-while <cmd> +while [!] <cmd> do [sequence of <cmd>] done @@ -922,10 +938,10 @@ done
until-do-done
- Execute [sequence of <cmd>] as long as <cmd> has a non-zero exit status.
+ Execute [sequence of <cmd>] as long as <cmd> has a non-zero exit status (or zero if inverted with !).
The syntax is as follows:
-until <cmd> +until [!] <cmd> do [sequence of <cmd>] done @@ -934,6 +950,10 @@ done
+ Note that while is equivalent to until if the command result is inverted.
+
The break Command.
A break command is also supported.
The break command is only meaningful within the body of the a while or until loop, between the do and done tokens.
@@ -3941,6 +3961,16 @@ set FOOBAR ABC_${FOO}_${BAR}
If CONFIG_NSH_ARGCAT is not selected, then a slightly small FLASH footprint results but then also only simple environment variables like $FOO can be used on the command line.
+
CONFIG_NSH_QUOTE$, `, ", and others must be retained intact as part of the test string.
+ This option is currently only available is CONFIG_NSH_ARGCAT is also selected.
+ CONFIG_NSH_NESTDEPTHCONFIG_NFILE_DESCRIPTORSCONFIG_NSH_ARCHINITCONFIG_NSH_ARCHROMFSCONFIG_NSH_ARCHROMFSCONFIG_NSH_ARGCATCONFIG_NSH_BUILTIN_APPSCONFIG_NSH_BUILTIN_APPSCONFIG_NSH_NESTDEPTHCONFIG_NSH_NETMASKCONFIG_NSH_NOMACCONFIG_NSH_QUOTECONFIG_NSH_READLINECONFIG_NSH_ROMFSDEVNOCONFIG_NSH_ROMFSETCCONFIG_NSH_ROMFSETCCONFIG_NSH_ARCHROMFSCONFIG_NSH_ROMFSMOUNTPTCONFIG_NSH_ROMFSSECTSIZECONFIG_NSH_STRERRORnicenshlib)nshlib), initializationnsh_consolemain()