Something went wrong. Try again.
Shells in OCaml forked from patrick.sirref.org/merry
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051While clauses.
$ cat > test.sh << EOF > i=1 > > while [ "\$i" -le 5 ] > do > echo "Iteration \$i..." > i=\$((i + 1)) > done > > EOF
$ sh test.sh Iteration 1... Iteration 2... Iteration 3... Iteration 4... Iteration 5... $ msh test.sh Iteration 1... Iteration 2... Iteration 3... Iteration 4... Iteration 5...
Also until loops.
$ cat > test.sh << EOF > i=1 > > until [ "\$i" -ge 5 ] > do > echo "Iteration \$i..." > i=\$((i + 1)) > done > > EOF
$ sh test.sh Iteration 1... Iteration 2... Iteration 3... Iteration 4... $ msh test.sh Iteration 1... Iteration 2... Iteration 3... Iteration 4...