From owner-freebsd-questions@FreeBSD.ORG Fri Oct 14 22:13:37 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E86CE16A46C for ; Fri, 14 Oct 2005 22:13:37 +0000 (GMT) (envelope-from willmaier@ml1.net) Received: from out3.smtp.messagingengine.com (out3.smtp.messagingengine.com [66.111.4.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 88BA343D45 for ; Fri, 14 Oct 2005 22:13:37 +0000 (GMT) (envelope-from willmaier@ml1.net) Received: from frontend1.internal (mysql-sessions.internal [10.202.2.149]) by frontend1.messagingengine.com (Postfix) with ESMTP id C9A7ECD1578 for ; Fri, 14 Oct 2005 18:13:35 -0400 (EDT) Received: from frontend2.messagingengine.com ([10.202.2.151]) by frontend1.internal (MEProxy); Fri, 14 Oct 2005 18:13:35 -0400 X-Sasl-enc: Uc6cuatF/2lqybZd+QkOjWfxyKZQ67HFHVf7pEL/IJQA 1129328013 Received: from merkur (host-66-202-74-42.choiceone.net [66.202.74.42]) by frontend2.messagingengine.com (Postfix) with ESMTP id 1708A570394 for ; Fri, 14 Oct 2005 18:13:32 -0400 (EDT) Received: by merkur (nbSMTP-1.00) for uid 1000 willmaier@ml1.net; Fri, 14 Oct 2005 17:13:39 -0500 (CDT) Date: Fri, 14 Oct 2005 17:13:38 -0500 From: Will Maier To: freebsd-questions@freebsd.org Message-ID: <20051014221338.GS29905@localdomain> Mail-Followup-To: freebsd-questions@freebsd.org References: <435027A3.8000908@mykitchentable.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <435027A3.8000908@mykitchentable.net> User-Agent: Mutt/1.5.6+20040907i Subject: Re: Help Understanding While Loop X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2005 22:13:38 -0000 On Fri, Oct 14, 2005 at 02:48:19PM -0700, Drew Tomlinson wrote: > OK, I've been working on an sh script and I'm almost there. In > the script, I created a 'while read' loop that is doing what I > want. Now I want to keep track of how many times the loop > executes. Thus I included this line between the 'while read' and > 'done' statements: > count = $(( count + 1 )) ^^^ You're missing something here ;) $ count=1 $ echo $count 1 $ count = $(( $count +1 )) # note: 'count =' count: not found $ ^[[A^C $ count=$(( $count + 1 )) # note: 'count=' $ echo $count 2 -- o--------------------------{ Will Maier }--------------------------o | jabber:..wcmaier@jabber.ccc.de | email:..........wcmaier@ml1.net | | \.........wcmaier@cae.wisc.edu | \..........wcmaier@cae.wisc.edu | *------------------[ BSD Unix: Live Free or Die ]------------------*