ambevar-dotfiles/.scripts/tc-text-scan

29 lines
512 B
Plaintext
Raw Normal View History

#!/bin/sh
2013-10-23 20:15:04 +02:00
if [ $# -eq 0 ] || [ "$1" = "-h" ]; then
cat<<EOF
Usage: ${1##*/} FOLDERS
Check for files containing common mispelling, like "`" and "´" instead of "'",
or "oe" instead of "œ".
EOF
fi
2014-08-19 11:06:03 +02:00
if ! command -v recode >/dev/null 2>&1; then
2013-10-23 20:15:04 +02:00
echo "recode needed."
exit
fi
for i ; do
while IFS= read -r j; do
echo -n "# "
file "$j"
grep -m1 "\`" "$j"
grep -m1 "´" "$j"
grep -m1 "oe" "$j"
done <<EOF
$(find "$i" -type f -size -50M -print)
EOF
2013-10-23 20:15:04 +02:00
done