From owner-freebsd-questions Sun Feb 7 07:18:45 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA06518 for freebsd-questions-outgoing; Sun, 7 Feb 1999 07:18:45 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from scientia.demon.co.uk (scientia.demon.co.uk [212.228.14.13]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id HAA06494 for ; Sun, 7 Feb 1999 07:18:27 -0800 (PST) (envelope-from ben@scientia.demon.co.uk) Received: from ben by scientia.demon.co.uk with local (Exim 2.11 #1) id 109UOp-000IfG-00; Sun, 7 Feb 1999 13:37:23 +0000 Date: Sun, 7 Feb 1999 13:37:23 +0000 From: Ben Smithurst To: root@isis.dynip.com Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Help About Shell Script Message-ID: <19990207133723.B71725@scientia.demon.co.uk> References: <199902071255.PAA36498@isis.dynip.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.1i In-Reply-To: <199902071255.PAA36498@isis.dynip.com> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG root@isis.dynip.com wrote: > in BASIC language terms, but in sh script ? > > for i = 0 to 1000 > for j = 0 to 1000 > do something using ( current i , current j ) > > increment j > next > increment i > next i=0 while [ $i -le 1000 ]; do j=0 while [ $j -le 1000 ]; do ## do your stuff here with $i and $j j=$(($j+1)) done i=$(($i+1)) done -- Ben Smithurst ben@scientia.demon.co.uk send a blank message to ben+pgp@scientia.demon.co.uk for PGP key To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message