clarify various entries
This commit is contained in:
@@ -39,22 +39,18 @@ case $CRE in
|
||||
esac
|
||||
|
||||
# While and Until
|
||||
This prints from 10 until 2.
|
||||
This prints from 1 until 9.
|
||||
|
||||
> declare -i COUNTER
|
||||
> COUNTER=1
|
||||
|
||||
> COUNTER=10
|
||||
> while [ $COUNTER -lt 2 ]; do
|
||||
|
||||
> while [ $COUNTER -gt 2 ]; do
|
||||
> ((COUNTER++))
|
||||
|
||||
> echo The counter is $COUNTER
|
||||
|
||||
> COUNTER=COUNTER-1
|
||||
> echo $COUNTER
|
||||
|
||||
> done
|
||||
|
||||
> exit 0
|
||||
|
||||
```
|
||||
|
||||
There's also 'until', which stops when something is true, rather than keeping going when something is true.
|
||||
|
Reference in New Issue
Block a user