Roman Rakus wrote: > This is realy strange. I have two examples > First: > > while [ 1 ]; do > while [ 1 ]; do > continue 0 > done > done > echo $? > > > Second: > > while [ 1 ]; do > while [ 1 ]; do > continue 0 > done > echo $? > done > echo $? > > In first case I have echoed 1. And I am expecting the same result in > second case, but I get 0. Can anyone help me and say where is the > difference?
continue [n] Resume the next iteration of the enclosing for, while, until, or select loop. If n is specified, resume at the nth enclosing loop. n must be >= 1. If n is greater than the number of enclosing loops, the last enclosing loop (the ‘‘top-level’’ loop) is resumed. The return value is 0 unless the shell is not executing a loop when continue is executed. -- D.