diff --git a/doc.zih.tu-dresden.de/util/grep-forbidden-words-testdoc.md b/doc.zih.tu-dresden.de/util/grep-forbidden-patterns.testdoc
similarity index 100%
rename from doc.zih.tu-dresden.de/util/grep-forbidden-words-testdoc.md
rename to doc.zih.tu-dresden.de/util/grep-forbidden-patterns.testdoc
diff --git a/doc.zih.tu-dresden.de/util/grep-forbidden-words.sh b/doc.zih.tu-dresden.de/util/grep-forbidden-words.sh
index a47314c36bcf41fb3a74eca3cfb1807809050c7f..e1a6846b2d71e0111e1e282c7db07c26d4b61ebf 100755
--- a/doc.zih.tu-dresden.de/util/grep-forbidden-words.sh
+++ b/doc.zih.tu-dresden.de/util/grep-forbidden-words.sh
@@ -39,6 +39,28 @@ function grepExceptions () {
   fi
 }
 
+function checkFile(){
+  f=$1
+  echo "Check wording in file $f"
+  while IFS=$'\t' read -r flags pattern exceptionPatterns; do
+    while IFS=$'\t' read -r -a exceptionPatternsArray; do
+      if [ $silent = false ]; then
+        echo "  Pattern: $pattern"
+      fi
+      grepflag=
+      case "$flags" in
+        "i")
+          grepflag=-i
+        ;;
+      esac
+      if grep -n $grepflag $color "$pattern" "$f" | grepExceptions "${exceptionPatternsArray[@]}" ; then
+        number_of_matches=`grep -n $grepflag $color "$pattern" "$f" | grepExceptions "${exceptionPatternsArray[@]}" | wc -l`
+        ((cnt=cnt+$number_of_matches))
+      fi
+    done <<< $exceptionPatterns
+  done <<< $ruleset
+}
+
 function usage () {
   echo "$0 [options]"
   echo "Search forbidden patterns in markdown files."
@@ -95,32 +117,19 @@ fi
 
 echo "... $files ..."
 cnt=0
-for f in $files; do
-  if [ "${f: -3}" == ".md" -a -f "$f" ]; then
-    if (printf '%s\n' "${whitelist[@]}" | grep -xq $f); then
-      echo "Skip whitelisted file $f"
-      continue
+if [[ ! -z $file ]]; then
+  checkFile $file
+else
+  for f in $files; do
+    if [ "${f: -3}" == ".md" -a -f "$f" ]; then
+      if (printf '%s\n' "${whitelist[@]}" | grep -xq $f); then
+        echo "Skip whitelisted file $f"
+        continue
+      fi
+      checkFile $f
     fi
-    echo "Check wording in file $f"
-    while IFS=$'\t' read -r flags pattern exceptionPatterns; do
-      while IFS=$'\t' read -r -a exceptionPatternsArray; do
-        if [ $silent = false ]; then
-          echo "  Pattern: $pattern"
-        fi
-        grepflag=
-        case "$flags" in
-          "i")
-            grepflag=-i
-          ;;
-        esac
-        if grep -n $grepflag $color "$pattern" "$f" | grepExceptions "${exceptionPatternsArray[@]}" ; then
-	  number_of_matches=`grep -n $grepflag $color "$pattern" "$f" | grepExceptions "${exceptionPatternsArray[@]}" | wc -l`
-          ((cnt=cnt+$number_of_matches))
-        fi
-      done <<< $exceptionPatterns
-    done <<< $ruleset
-  fi
-done
+  done
+fi
 
 echo "" 
 case $cnt in
diff --git a/doc.zih.tu-dresden.de/util/test-grep-forbidden-words.sh b/doc.zih.tu-dresden.de/util/test-grep-forbidden-words.sh
index 8efd92432c066a42f6bc76f8a89ea66120925a9a..d5d13ffc4ffc2f1f63332ca628f1449525ee1690 100755
--- a/doc.zih.tu-dresden.de/util/test-grep-forbidden-words.sh
+++ b/doc.zih.tu-dresden.de/util/test-grep-forbidden-words.sh
@@ -1,11 +1,13 @@
 #!/bin/bash
 
-number_of_matches=$(bash ./doc.zih.tu-dresden.de/util/grep-forbidden-words.sh -f doc.zih.tu-dresden.de/util/grep-forbidden-words-testdoc.md -c -c | grep "Forbidden Patterns:" | sed -e 's/.*: //' | sed -e 's/ matches.*//')
+expected_match_count=32
 
-if [ $number_of_matches -eq 32 ]; then
+number_of_matches=$(bash ./doc.zih.tu-dresden.de/util/grep-forbidden-words.sh -f doc.zih.tu-dresden.de/util/grep-forbidden-patterns.testdoc -c -c | grep "Forbidden Patterns:" | sed -e 's/.*: //' | sed -e 's/ matches.*//')
+
+if [ $number_of_matches -eq $expected_match_count ]; then
 	echo "Test OK"
 	exit 0
 else
-	echo "Test failed"
+	echo "Test failed: $expected_match_count matches expected, but only $number_of_matches found"
 	exit 1
 fi