[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: simple bash loop problem ...



On Sat, Jun 28, 2003 at 03:03:27PM +0100, David selby wrote:
> I am writing bash a bash & sed script, it has been going suprisingly 
> well. I need a loop to count 9 times & the variable n to the count ..
> 
> for n=1 to 9
> ....
> next

  for n in $(seq 1 9); do
    ...
  done

> kind of thing, but this is not BASIC !!
> 
> My best guess is
> 
> declare -i n=1
> while [ $n < 9 ]; do

See the test(1) man page; you need -lt here, not <.

Cheers,

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]



Reply to: