From owner-freebsd-questions Tue Jul 17 14: 7:53 2001 Delivered-To: freebsd-questions@freebsd.org Received: from maine.60north.net (maine.60north.net [198.143.201.10]) by hub.freebsd.org (Postfix) with ESMTP id EF2BC37B405 for ; Tue, 17 Jul 2001 14:07:50 -0700 (PDT) (envelope-from bill@maine.60north.net) Received: from localhost (bill@localhost) by maine.60north.net (8.11.3/8.11.3) with ESMTP id f6HL7jO90823; Tue, 17 Jul 2001 17:07:45 -0400 (EDT) Date: Tue, 17 Jul 2001 17:07:45 -0400 (EDT) From: bill To: Mark Drayton Cc: freebsd-questions@FreeBSD.ORG Subject: Re: sh for loop In-Reply-To: <20010717214314.A2960@drex.staff.izr.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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