From owner-freebsd-questions Tue Jul 17 18:26:57 2001 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-27-141-144.mmcable.com [24.27.141.144]) by hub.freebsd.org (Postfix) with SMTP id E5F0637B406 for ; Tue, 17 Jul 2001 18:26:50 -0700 (PDT) (envelope-from mwm@mired.org) Received: (qmail 84324 invoked by uid 100); 18 Jul 2001 00:58:48 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15188.57160.799562.343400@guru.mired.org> Date: Tue, 17 Jul 2001 19:58:48 -0500 To: Mark Drayton , bill Cc: questions@freebsd.org Subject: Re: sh for loop In-Reply-To: <52572270@toto.iv> X-Mailer: VM 6.90 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ 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 Mark Drayton types: > 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 bill types: > I would do this... > INC=`expr $INC + 1` > cheers! Personally, I'd use jot: for i in `jot 10` do echo $i done See the jot man page for more information. http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message