summaryrefslogtreecommitdiffstats
path: root/.local/bin/weasel
diff options
context:
space:
mode:
authorYigit Sever2021-11-07 23:42:15 +0300
committerYigit Sever2021-11-07 23:42:15 +0300
commit9fa9973c2d2f91cef7bdd26cb52064c13f4d682e (patch)
tree13aa64b09bc91e16f3dd3217bf3d647559af2cf9 /.local/bin/weasel
parent9382166b5522a5d9e2d62e93e702b4d0886cedb4 (diff)
parentfcb2237c01bcd2b7982bb844cea4cf9447f20d03 (diff)
downloaddotfiles-9fa9973c2d2f91cef7bdd26cb52064c13f4d682e.tar.gz
dotfiles-9fa9973c2d2f91cef7bdd26cb52064c13f4d682e.tar.bz2
dotfiles-9fa9973c2d2f91cef7bdd26cb52064c13f4d682e.zip
Merge remote-tracking branch 'origin/main'
Diffstat (limited to '.local/bin/weasel')
-rwxr-xr-x.local/bin/weasel38
1 files changed, 38 insertions, 0 deletions
diff --git a/.local/bin/weasel b/.local/bin/weasel
new file mode 100755
index 0000000..ce82ce3
--- /dev/null
+++ b/.local/bin/weasel
@@ -0,0 +1,38 @@
1#!/usr/bin/env bash
2
3weasels="many|various|very|fairly|several|extremely\
4 |exceedingly|quite|remarkably|few|surprisingly\
5 |mostly|largely|huge|tiny|((are|is) a number)\
6 |excellent|interestingly|significantly\
7 |substantially|clearly|vast|relatively|completely"
8
9wordfile=""
10
11# Check for an alternate weasel file
12if [ -f "$HOME"/etc/words/weasels ]; then
13 wordfile="$HOME/etc/words/weasels"
14fi
15
16if [ -f "$WORDSDIR"/weasels ]; then
17 wordfile="$WORDSDIR/weasels"
18fi
19
20if [ -f words/weasels ]; then
21 wordfile="words/weasels"
22fi
23
24if [ ! "$wordfile" = "" ]; then
25 weasels="xyzabc123"
26 for w in $(cat $wordfile); do
27 weasels="$weasels|$w"
28 done
29fi
30
31if [ "$1" = "" ]; then
32 echo "usage: $(basename "$0") <file> ..."
33 exit
34fi
35
36grep -E -i -n --color "\\b($weasels)\\b" "$*"
37
38exit $?