From owner-freebsd-questions Tue Jul 17 17:40:31 2001 Delivered-To: freebsd-questions@freebsd.org Received: from smtp-2.enteract.com (smtp-2.enteract.com [207.229.143.4]) by hub.freebsd.org (Postfix) with ESMTP id BFE0737B403 for ; Tue, 17 Jul 2001 17:40:28 -0700 (PDT) (envelope-from dscheidt@tumbolia.com) Received: from shell-1.enteract.com (shell-1.enteract.com [207.229.143.40]) by smtp-2.enteract.com (Postfix) with ESMTP id 09B0B5FAC; Tue, 17 Jul 2001 19:40:28 -0500 (CDT) Date: Tue, 17 Jul 2001 19:40:28 -0500 (CDT) From: David Scheidt X-X-Sender: To: Mark Drayton Cc: 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 On Tue, 17 Jul 2001, Mark Drayton wrote: :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. for i in ` jot 10 1` do foo done will do what you want. Unfortunatly, jot doesn't exist on all Unixes, so if the script is to be portable, you should do it with shell math -- dscheidt@tumbolia.com Bipedalism is only a fad. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message