[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:
> Hello,
> 
> 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

[506]hugh@anni:~$ cat ./bashtest 
#!/bin/bash
i=0
while [ $i -lt 9 ]
  do echo f00
  i=$((++i))
done
[507]hugh@anni:~$ ./bashtest 
f00
f00
f00
f00
f00
f00
f00
f00
f00

hope that helps

-- 
hugh

Attachment: pgpDu9qOVyLH8.pgp
Description: PGP signature


Reply to: