All pastes #1980270 Raw Edit

anssi

public text v1 · immutable
#1980270 ·published 2010-11-03 03:36 UTC
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