From owner-freebsd-questions Wed Jul 18 2:59:36 2001 Delivered-To: freebsd-questions@freebsd.org Received: from antares.gecadsoftware.com (antares.gecadsoftware.com [193.230.167.76]) by hub.freebsd.org (Postfix) with SMTP id 26F8737B401 for ; Wed, 18 Jul 2001 02:59:32 -0700 (PDT) (envelope-from teo@gecadsoftware.com) Received: (qmail 32997 invoked from network); 18 Jul 2001 10:01:41 -0000 Received: from unknown (HELO taz.gecadsoftware.com) (193.230.245.17) by antares.gecadsoftware.com with SMTP; 18 Jul 2001 10:01:40 -0000 Received: from teo.gecadsoftware.com ([193.230.245.169]) by taz.gecadsoftware.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id P1RW87F8; Wed, 18 Jul 2001 12:57:06 +0300 Received: (qmail 967 invoked by uid 500); 18 Jul 2001 09:57:04 -0000 Date: Wed, 18 Jul 2001 12:57:04 +0300 From: teo@gecadsoftware.com To: freebsd-questions@freebsd.org Subject: Re: sh for loop Message-ID: <20010718125704.B909@gecadsoftware.com> Reply-To: teo@gecadsoftware.com Mail-Followup-To: teo@gecadsoftware.com, freebsd-questions@freebsd.org References: <20010717214314.A2960@drex.staff.izr.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.15i In-Reply-To: <20010717214314.A2960@drex.staff.izr.com>; from mark.drayton@izr.com on Tue, Jul 17, 2001 at 09:43:14PM +0100 Organization: GeCAD Software Comment: Worry less, RAV is watching! X-Operating-System: Linux 2.2.16 i686 up 47 min 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 Hi Mark! 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 [bash magik] for((i=1;i<11;++i)); 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 -- teodor To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message