#!/bin/bash # checkoccurence.sh file1="datei1.txt" file2="datei2.txt" while IFS= read -r line do if grep -Fxq "$line" "$file2" then echo "$line kommt in beiden Dateien vor" #else # echo "$line kommt nur in datei1.txt vor" fi done < "$file1"