René Nyffenegger's collection of things on the web | |
René Nyffenegger on Oracle - Most wanted - Feedback
- Follow @renenyffenegger
|
continue [shells] | ||
continue [n]
continue can be used in the loop commandos while, for and until. It causes the loop
to skip the part after the continue. n is optional and specifies the deepness of levels of loops that is skipped.
Here's a little demonstration.
for a in 1 2 3; do for b in 1 2 3; do for c in 1 2 3; do echo a: $a, b: $b, c: $c continue $a echo "never reached" done done done a: 1, b: 1, c: 1 a: 1, b: 1, c: 2 a: 1, b: 1, c: 3 a: 1, b: 2, c: 1 a: 1, b: 2, c: 2 a: 1, b: 2, c: 3 a: 1, b: 3, c: 1 a: 1, b: 3, c: 2 a: 1, b: 3, c: 3 a: 2, b: 1, c: 1 a: 2, b: 2, c: 1 a: 2, b: 3, c: 1 a: 3, b: 1, c: 1 |