From 23b32baf9800e19d57d1f7f037baa200c3c4cb8f Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 1 Oct 2018 14:28:07 -0600 Subject: [PATCH] apps/nshlib: Update README.txt --- nshlib/README.txt | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/nshlib/README.txt b/nshlib/README.txt index fa2b8d508..4ef09c339 100644 --- a/nshlib/README.txt +++ b/nshlib/README.txt @@ -540,7 +540,7 @@ o export [] foo=bar dog=poop - The export is command is not supported by NSH unless both CONFIG_NSH_VARS=y + The export command is not supported by NSH unless both CONFIG_NSH_VARS=y and CONFIG_DISABLE_ENVIRON is not set. o free @@ -1104,7 +1104,7 @@ o route ipv4|ipv6 o set [{+|-}{e|x|xe|ex}] [ ] - Set the variable to the sting and or set NSH parser control + Set the variable to the string and or set NSH parser control options. For example, a variable may be set like this: @@ -1116,7 +1116,7 @@ o set [{+|-}{e|x|xe|ex}] [ ] foovalue nsh> - If CONFIG_NSH_VARS is set, the effect of the 'set' command is to set the local + If CONFIG_NSH_VARS is set, the effect of this 'set' command is to set the local NSH variable. Otherwise, the group-wide environment variable will be set. Set the 'exit on error control' and/or 'print a trace' of commands when parsing @@ -1264,7 +1264,7 @@ o umount o unset Remove the value associated with the variable . This will remove - the name-value pairt from both the NSH local variables and the group-wide + the name-value pair from both the NSH local variables and the group-wide environment variables. For example: nsh> echo $foobar @@ -1592,6 +1592,36 @@ NSH-Specific Configuration Settings FLASH footprint results but then also only simple environment variables like $FOO can be used on the command line. + * CONFIG_NSH_VARS + By default, there are no internal NSH variables. NSH will use OS + environment variables for all variable storage. If this option, NSH + will also support local NSH variables. These variables are, for the + most part, transparent and work just like the OS environment + variables. The difference is that when you create new tasks, all of + environment variables are inherited by the created tasks. NSH local + variables are not. + + If this option is enabled (and CONFIG_DISABLE_ENVIRON is not), then a + new command called 'export' is enabled. The export command works very + must like the set command except that is operates on environment + variables. When CONFIG_NSH_VARS is enabled, there are changes in the + behavior of certain commands + + ============== =========================== =========================== + CMD w/o CONFIG_NSH_VARS w/CONFIG_NSH_VARS + ============== =========================== =========================== + set Set environment var a to b Set NSH var a to b + unset Unsets environment var a Unsets both environment var + and NSH var a + export Causes an error Unsets NSH var a. Sets + environment var a to b. + export Causes an error Sets environment var a to + NSH var b (or ""). Unsets + local var a. + env Lists all environment Lists all environment + variables variables + ============== =========================== =========================== + * 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