diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-01-17 15:56:32 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-01-17 15:56:32 -0600 |
commit | e33bd6bd784ba0334beb0481d82416be38fbb54d (patch) | |
tree | b87ce3e8c39930580c812fdee5cdfed7d700fd8a /apps/nshlib/README.txt | |
parent | 3895a010a5c8d971ec04802ae569f44a06bd572b (diff) | |
download | nuttx-e33bd6bd784ba0334beb0481d82416be38fbb54d.tar.gz nuttx-e33bd6bd784ba0334beb0481d82416be38fbb54d.tar.bz2 nuttx-e33bd6bd784ba0334beb0481d82416be38fbb54d.zip |
NSH: Add support for while-do-done and until-do-done loops
Diffstat (limited to 'apps/nshlib/README.txt')
-rw-r--r-- | apps/nshlib/README.txt | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/apps/nshlib/README.txt b/apps/nshlib/README.txt index 11d692dc1..1e4731066 100644 --- a/apps/nshlib/README.txt +++ b/apps/nshlib/README.txt @@ -104,6 +104,23 @@ Conditional Command Execution [sequence of <cmd>] fi +Looping +^^^^^^^ + + while-do-done and until-do-done looping constructs are also supported. + These works from the command line but are primarily intended for use + within NSH scripts (see the sh command). The syntax is as follows: + + while <test-cmd>; do <cmd-sequence>; done + + Execute <cmd-sequence> as long as <test-cmd> has an exit status of + zero. + + until <test-cmd>; do <cmd-sequence>; done + + Execute <cmd-sequence> as long as <test-cmd> has a non-zero exit + status. + Built-In Variables ^^^^^^^^^^^^^^^^^^ |