diff options
author | Michael Kerrisk <mtk@konstanz.(none)> | 2010-08-29 14:41:52 +0200 |
---|---|---|
committer | Michael Kerrisk <mtk@konstanz.(none)> | 2010-08-29 14:41:52 +0200 |
commit | 606043ca6773a7a159903e027157a096694fbb99 (patch) | |
tree | bb7652340445cc901e941ecb3d908997a170b802 /scripts | |
parent | cc3707c028a735efc3d66b46b71c870c882a3383 (diff) |
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)>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/find_repeated_words.sh | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/scripts/find_repeated_words.sh b/scripts/find_repeated_words.sh index eac6b3838..cca6964f4 100644 --- a/scripts/find_repeated_words.sh +++ b/scripts/find_repeated_words.sh @@ -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" |