[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Strange return codes of continue
From: |
Dave B |
Subject: |
Re: Strange return codes of continue |
Date: |
Fri, 27 Jun 2008 12:51:27 +0200 |
User-agent: |
Thunderbird 2.0.0.14 (X11/20080529) |
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.