Skip to main content
added 19 characters in body
Source Link
Siva
  • 9.3k
  • 9
  • 60
  • 88

Try this,

Count=0
for i in {$start..$stop}; do
   Counter="$(ls /home/me/*/file_$i.txt 2> /dev/null | wc -l)"
   Count=$((Count+Counter))
done
echo "$Count"

Try this,

Count=0
for i in {$start..$stop}; do
   Counter="$(ls /home/me/*/file_$i.txt 2> /dev/null | wc -l)"
   Count=$((Count+Counter))
done

Try this,

Count=0
for i in {$start..$stop}; do
   Counter="$(ls /home/me/*/file_$i.txt 2> /dev/null | wc -l)"
   Count=$((Count+Counter))
done
echo "$Count"
Source Link
Siva
  • 9.3k
  • 9
  • 60
  • 88

Try this,

Count=0
for i in {$start..$stop}; do
   Counter="$(ls /home/me/*/file_$i.txt 2> /dev/null | wc -l)"
   Count=$((Count+Counter))
done