-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweasel
executable file
·38 lines (28 loc) · 1.58 KB
/
weasel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env bash
weasels="a lot|about|acts|again|all|almost|already|also|anyway|appeared|appears|are a number|arguably|back|be able to|began|believed|better|bit|clearly|close|combats|completely|considered|could|decided|down|effective|efficient|enough|even|ever|exceedingly|excellent|expert|experts|extremely|fairly|far|felt|few|gains|heard|helps|huge|improved|interestingly|is a number|is like|just|knew|largely|like|linked to|literally|looked|looks|lots|many|might|most|mostly|not rocket science|noticed|often|only|outside the box|over|own|pretty|probably|quite|rather|real|realised|realized|really|recognised|recognized|relatively|remarkably|reportedly|saw|seemed|seems|several|significantly|smelled|so|some|somehow|sort|started|still|substantially|supports|supposed|surprisingly|then|thought|tiny|touched|understood|up|useful|various|vast(ly)|very|virtually|wanted|watched|well|wished|wondered|works|research shows|experts say|we would say that|often|probably|possibly|some|many|could be|the user|the person|that being said|great"
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
cat $* |\
gsed '/^\s*%/c\%' |\
egrep -i -n --color=always "\\b($weasels)\\b" |\
less -R
exit $?