From owner-freebsd-questions Tue Jul 17 13:43:52 2001 Delivered-To: freebsd-questions@freebsd.org Received: from drex.staff.izr.com (drex.staff.izr.com [195.26.38.16]) by hub.freebsd.org (Postfix) with ESMTP id DE0F237B405 for ; Tue, 17 Jul 2001 13:43:49 -0700 (PDT) (envelope-from mark@drex.staff.izr.com) Received: by drex.staff.izr.com (Postfix, from userid 1001) id 890823379E; Tue, 17 Jul 2001 21:43:14 +0100 (BST) Date: Tue, 17 Jul 2001 21:43:14 +0100 From: Mark Drayton To: freebsd-questions@freebsd.org Subject: sh for loop Message-ID: <20010717214314.A2960@drex.staff.izr.com> Mail-Followup-To: freebsd-questions@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i 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 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