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

29 lines
467 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#!/bin/sh
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
if ! command -v recode >/dev/null 2>&1; then
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
done