find_repeated_words.sh: Fix bug

setting of MANWIDTH needs to be in environmnt of "man -l"

Signed-off-by: Michael Kerrisk <mtk@konstanz.(none)>
This commit is contained in:
Michael Kerrisk 2010-08-29 14:41:52 +02:00
parent cc3707c028
commit 606043ca67
1 changed files with 3 additions and 4 deletions

View File

@ -7,12 +7,11 @@
# Usage: sh find_repeated_words.sh [file...]
#
MANWIDTH=2000
for file in "$@" ; do
words=$(man -l "$file" 2> /dev/null | col -b | \
words=$(MANWIDTH=2000 man -l "$file" 2> /dev/null | col -b | \
tr ' \008' '\012' | sed -e '/^$/d' | \
awk 'BEGIN {p=""} {if (p==$0) print p; p=$0 }' | \
sed 's/ *$//' |
awk 'BEGIN {p=""} {if (p==$0) print p; p=$0}' | \
grep '[a-zA-Z]' | tr '\012' ' ')
if test -n "$words"; then
echo "$file: $words"