count=0
function walk()
{
for file in `ls $1`
do
local path=$1"/"$file
if [ -d $path ]
then
echo "DIR $path"
walk $path
else
echo "FILE $path"
num=$(wc -l $path | awk '{ print $1 }')
echo $num
count=`expr $count + $num`
fi
done
}
walk miwifi
echo $count
网友评论