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

30 lines
470 B
Plaintext
Raw Normal View History

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