Created
February 9, 2017 11:51
-
-
Save lengerfulluse/f468666fad5a12953d65cda14c77ea47 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
loop=0 | |
sum=0 | |
str=`ls` | |
arr=($str) | |
while [ $loop -lt 100 ]; do | |
res=`wc -l ${arr[$loop]}` | |
line=`echo $res | cut -d' ' -f1` | |
echo $line | |
sum=$(($sum+$line)) | |
loop=$(($loop+1)) | |
done | |
echo "total sum is: $sum" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment