(naive, but good enough!)
total_words=0
folder=./*
for file in $folder; do
if [ -f "$file" ](<../ -f "$file" >); then
words=$(wc -w < "$file")
total_words=$((total_words + words))
fi
done
echo $total_words
(naive, but good enough!)
total_words=0
folder=./*
for file in $folder; do
if [ -f "$file" ](<../ -f "$file" >); then
words=$(wc -w < "$file")
total_words=$((total_words + words))
fi
done
echo $total_words