Skip to content

Instantly share code, notes, and snippets.

@willis7
Last active August 20, 2018 08:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willis7/612c179d5b5ae3da8ff2492bf5db5815 to your computer and use it in GitHub Desktop.
Save willis7/612c179d5b5ae3da8ff2492bf5db5815 to your computer and use it in GitHub Desktop.
A script to find weasel words
#!/bin/bash
weasels="many|various|very|fairly|several|extremely\
|exceedingly|quite|remarkably|few|surprisingly\
|mostly|largely|huge|tiny|((are|is) a number)\
|excellent|interestingly|significantly\
|substantially|clearly|vast|relatively|completely"
wordfile=""
# Check for an alternate weasel file
if [ -f $HOME/etc/words/weasels ]; then
wordfile="$HOME/etc/words/weasels"
fi
if [ -f $WORDSDIR/weasels ]; then
wordfile="$WORDSDIR/weasels"
fi
if [ -f words/weasels ]; then
wordfile="words/weasels"
fi
if [ ! "$wordfile" = "" ]; then
weasels="xyzabc123";
for w in `cat $wordfile`; do
weasels="$weasels|$w"
done
fi
if [ "$1" = "" ]; then
echo "usage: `basename $0` <file> ..."
exit
fi
egrep -i -n --color "\\b($weasels)\\b" $*
exit $?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment