How to implement the counter in loop?

Hi,

I am working on a script where I need to add one functionality i.e. to could the number of tar files at particular location...but the script is working in below way.
1) create sandbox
2) Drop old member function
3) addmember function
4) Apply checkpoint lable
5) Resync operation(This resync operation occurs at particlar location

 /mnt/projects/temp/

and script runs in loops..it fetchs the data
from some particular file

stp/wsSTP:app:STP_12_02_01_00_RC01.tar.gz
stp/gwSTP:web:STP_12_02_01_00_RC01.tar.gz
stpbatch:app:STP_12_02_01_00_RC01.tar.gz
stpmon:app:STPMON_12_02_01_00_RC01.tar.gz
tag:app:STPPRODUCTS_12_02_01_00_RC01.tar.gz
stpweb:web:STPWEB_12_02_01_00_RC01.tar.gz

script pick one line at a time and do the above operation I want when it do resync operation it find the tar ball in above resyn location and count..and each resync operation it will do the same .After that I can find the number of tar balls resync is equal to number of line in abobe file.This can be done only if I know how to implment the counter

suppose
count=0[initally]
resync operation occur
it founds one tar ball /mnt/projetcs/temp
count=0+1
count=1
again script do all it part and now doing resyc operation in
/mnt/projects/temp and found one tar ball
count=1+1
count=2

You might want to read the man page of the shell you are using (and which you forgot to tell us), specifically the chapter about "Arithmetic Operations" or something such.

Use

typeset -i integervar=0

to declare a variable. Use

(( integervar += 1 ))

to increment the variable. Notice that "((" and "))" HAS TO HAVE a space char after/before it, otherwise it will not work as expected. In the following the first line is correct, the second is not:

(( integervar += 1 ))  # correct
((integervar += 1))    # WRONG!

I hope this helps.

bakunin