well i just dont know what happened, my grep results counter used to work and now it seems that no matter what i do it doesn't count my results and stay on the initial value of 0, at the first line of the script i initiating it:
TotalResults=0
even if i define it in that way:
typeset -i TotalResults=0
it won't work , that's the while loop which in it the counter should grow and it actually doing the other commands, it's doing the printf stuff but just not increasing the counter, i checked it with echo and also when i want to use it, it stays on 0!
export URL="$CurrentURL"
grep -n -o -a $ExpressionValue $INDEX | while read line ; do
printf "%s\t%s" "${URL} ${line}" printf "\n" let TotalResults+=1
done
what is the problem? I have other counter that defined the same and he is working great, I'm tired of that, please help.