rendered paste body#!/bin/bash# http://www.python.org/dev/peps/pep-0263/for file in $(find "$@" -name '*.py' | LC_ALL=C xargs grep -l '[^[:print:][:cntrl:]]'); do ! [ -e "$file" ] && echo =========== Nothing found. && continue if ! head -n2 "$file" | grep -q coding && ! hexdump -Cn3 "$file" | grep -q "ef bb bf"; then encoding="$(file -b --mime-encoding "$file")" echo "=========== File "$file" contains at least $encoding characters without encoding declaration:" LC_ALL=C grep '[^[:print:][:cntrl:]]' "$file" fidone