Execution Problems with the value is not store in a variable

#!/bin/bash
filecount=0
dirname=path.log
exec<$dirname
while read line # line by line read source file name and stored in a veribale
do
        sourcedirname=$line
        (   
        count=`ls $sourcedirname |wc -l`
        filecount=`expr $filecount + $count` 
        echo $filecount
        )   
done

This is the script . The output of this script is :

6
2

But actual should be :

6
8

Two directory path are mention in path.log file.

/home/test1
/home/test2

6 file present in test1 directory and 2 file present in test2 directory. I want to add the total file of those directory. Directory may be increase, here only two directory.

You are invoking a subshell each time in the loop and hence the variable $filecount is reset each time. don't use braces.

Thanks a lot

Its work fine