Hi Peter, There could be many reasons, for example if your CONFIG_NSH_DISABLE_ITEF is enable, etc...
$ cd apps/ $ git grep "not valid in this context" nshlib/nsh_parse.c:const char g_fmtcontext[] = "nsh: %s: not valid in this context\n"; Please take a look, this is a good exercise to master NuttX. BR, Alan On 2/27/20, Petr Buchta <cz7...@googlemail.com.invalid> wrote: > Hi, > I keep exploring nuttx and I'm trying to use loops in the nsh console. The > problem is I'm geting this error - "nsh: while: not valid in this context" > > What I simply tried was: > nsh> while true; do myapp; sleep 1; done > > Even splitting to multiple lines without the semicolon doesn't work. What > am I missing? > > Also is there a way to iterate over a numeric range? I understand there's > no support for for loops, even a basic one like - "for i in 1 2 3; do ...; > done". So is there a way how to do a similar thing using while loop and > incrementing a numeric variable? > > Thanks for help. > Petr >