On Thu, Feb 20, 2003 at 02:36:39PM +1300, Nick Rout wrote:
> #!/bin/bash
> 
> iter=$1
> while $iter>0 ; do

while [ "$iter" -lt "0" ]; do

while just runs the following program, and acts on the return value...

bash-2.05b$ which [
/usr/bin/[
bash-2.05b$ ls -l /usr/bin/[
lrwxrwxrwx    1 root     root            4 Feb 12 12:15 /usr/bin/[ -> test

from test(1):
SYNOPSIS
       test EXPRESSION
       [ EXPRESSION ]

> echo "rubbish"
> iter=$iter-1

let iter=$iter-1
or
iter=$(expr $iter - 1)
or
iter=$(($iter-1))

> done

Mike.
-- 
Michael Beattie <[EMAIL PROTECTED]>

"This isnt Mission Difficult Mr Hunt, this is Mission Impossible.
Difficult should be a walk in the park for you."  -- MI:2

Reply via email to