Added set [{+|-}{e|x|xe|ex}] [<name> <value>] to nsh (#6985)

* NSH Added support for set [{+|-}{e|x|xe|ex}] [<name> <value>]

   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.

   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.

   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.

  Print expanded variables if -x

* Added comments only on how to use the set +e and and set -x

* Spelling NSH_PFALG_* -> NSH_PFLAG_*
This commit is contained in:
David Sidrane authored and GitHub committed 2017-04-06 03:42:16 -10:00
1 parent 392a9fbb19
commit cc04dfd27b
2 files changed
+318 -1

No files matched your search

+4 -1
View File
@@ -1,5 +1,8 @@
#!nsh
#
# Un comment and use set +e to ignore and set -e to enable 'exit on error control'
#set +e
# Un comment the line below to help debug scripts by printing a trace of the script commands
#set -x
# PX4FMU startup script.
#
# NOTE: environment variable references: