I got the following codes in my shell script (using /bin/sh) :
while read ip other
if [ $PREV_IP != $ip ]
printf "IP %s has visited\n" $ip
this_count=`expr $this_count + 1`;export this_count
done < $TEMP_FILE
echo value of count is $this_count
I expected that I could get the value of count "this_count" after loop
but actually, I only got "0" as the value, no matter how much iteration
the loop has performed.
Can anyone tell me what's happened to this shell script? How can I
retrieve values from the loop?
Thanks a lot.