Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Jul 2001 17:07:45 -0400 (EDT)
From:      bill <bill@maine.60north.net>
To:        Mark Drayton <mark.drayton@izr.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: sh for loop
Message-ID:  <Pine.BSF.4.21.0107171705390.90699-100000@maine.60north.net>
In-Reply-To: <20010717214314.A2960@drex.staff.izr.com>

next in thread | previous in thread | raw e-mail | index | archive | help
I would do this... 
INC=`expr $INC + 1` 
cheers!

On Tue, 17 Jul 2001, Mark Drayton wrote:

> Hi
> 
> As part of a shell script I need to write a for loop that iterates from
> 1 to 10 inclusive. I know I can use this:
> 
> for i in 1 2 3 4 5 6 7 8 9 10; do
> 	echo $i
> done
> 
> However, that's a pretty nasty way of doing it. I've seen a function
> that will create the list "1 2 3 4 5 6 7 8 9 10" but I can't for the
> life of me remember what it is. I think it's something like (range 1 10)
> or (list 1 10), but no amount of google searching has jogged my memory.
> 
> Any ideas?
> 
> -- 
> 
> Mark Drayton
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
> 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0107171705390.90699-100000>