#!/usr/bin/bash # while IFS= read -r line; do echo "$line" txt=`grep 'frage' $line` echo "***`echo "$txt" | wc -l`***" echo done < "allfiles.log"