2007-03-01 16:24:55 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# A simple script for finding instances of repeated consecutive words
|
|
|
|
# in manual pages -- human inspection can then determine if these
|
|
|
|
# are real errors in the text.
|
|
|
|
#
|
|
|
|
# Usage: sh find_repeated_words.sh [file...]
|
|
|
|
#
|
2007-09-10 04:14:12 +00:00
|
|
|
|
2007-03-01 16:24:55 +00:00
|
|
|
for file in "$@" ; do
|
2010-08-29 12:41:52 +00:00
|
|
|
words=$(MANWIDTH=2000 man -l "$file" 2> /dev/null | col -b | \
|
2007-03-01 16:24:55 +00:00
|
|
|
tr ' \008' '\012' | sed -e '/^$/d' | \
|
2010-08-29 12:41:52 +00:00
|
|
|
sed 's/ *$//' |
|
|
|
|
awk 'BEGIN {p=""} {if (p==$0) print p; p=$0}' | \
|
2007-03-01 16:24:55 +00:00
|
|
|
grep '[a-zA-Z]' | tr '\012' ' ')
|
2007-09-19 21:23:50 +00:00
|
|
|
if test -n "$words"; then
|
2007-03-01 16:24:55 +00:00
|
|
|
echo "$file: $words"
|
|
|
|
fi
|
|
|
|
done
|