I am trying to find total size of a current directory and the shell script is failing at expr command. below is my code:
#!/bin/sh
echo "This program summarizes the space size of current directory"
sum=0
for filename in *.sh
do
fsize=`du -b $filename`
echo "file name is: $filename Size is:$fsize"
sum=`expr $sum + $fsize`
done
echo "Total space of the directory is $sum"