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:[EMAIL PROTECTED] | email:[EMAIL PROTECTED] |
| [EMAIL PROTECTED] | [EMAIL PROTECTED] |
*------------------[ BSD Unix: Live Free or Die ]------------------*

_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to