脚本中变量的有关问题

脚本中变量的问题index111cat $m3u8FileName | while read linedoindex+1doneecho $index为什么 这样最

脚本中变量的问题

index=111

cat $m3u8FileName | while read line
do
index+=1
done
echo $index

为什么 这样
最后index还是111
循环最后没有改变的index的值  

求大神指导  谢了!!!
[解决办法]
sub shell 的问题