35 lines
534 B
Bash
Executable File
35 lines
534 B
Bash
Executable File
#!/bin/sh
|
||
|
||
usage () {
|
||
cat <<EOF>&2
|
||
Usage: ${0##*/} FOLDERS
|
||
|
||
Check for files containing common mispelling:
|
||
|
||
- "\`" and "´" instead of "'",
|
||
- "oe" instead of "œ".
|
||
|
||
EOF
|
||
}
|
||
|
||
[ $# -eq 0 ] && usage && exit 1
|
||
[ "$1" = "-h" ] && usage && exit
|
||
[ "$1" = "--" ] && shift
|
||
|
||
if ! command -v recode >/dev/null 2>&1; then
|
||
echo >&2 "recode needed."
|
||
exit 1
|
||
fi
|
||
|
||
for i ; do
|
||
while IFS= read -r j; do
|
||
printf "# "
|
||
file "$j"
|
||
grep -m1 "\`" "$j"
|
||
grep -m1 "´" "$j"
|
||
grep -m1 "oe" "$j"
|
||
done <<EOF
|
||
$(find "$i" -type f -size -50M -print)
|
||
EOF
|
||
done
|