-for x in $(find $directory -type f); do
- if LC_ALL=C grep -q '[^[:print:][:space:]]' "$x"; then
- echo "file "$x" contains non-ascii characters"
- exit 1
- fi
-done
+if LC_ALL=C grep -r '[^[:print:][:space:]]' "$directory"; then
+ echo "Found files containing non-ascii characters."
+ exit 1
+fi