execline
Software
www.skarnet.org
The loopwhile program
loopwhile performs a conditional loop.
Interface
loopwhile [ -n ] ~prog... ; remainder...
or in a execlineb script:
loopwhile [ -n ] { prog... } remainder...
- loopwhile reads prog... in a
block and unquotes it.
- It runs prog... as a child process and
waits for it to complete.
- As long as prog exits zero, loopwhile runs it again.
- loopwhile then execs into remainder....
Options
- -n : negate the test: run prog... as long as it exits non-zero.
Note
Be careful: execline maintains no state, in particular it
uses no real variables, and environment will
be of no use here since every instance of prog... runs as a separate
child process. To avoid being stuck in an infinite loop, prog...
should modify some external state - for instance, the filesystem.