diff options
| author | Zach DeCook <zachdecook@librem.one> | 2022-04-28 10:35:07 -0400 |
|---|---|---|
| committer | Zach DeCook <zachdecook@librem.one> | 2022-04-28 10:35:07 -0400 |
| commit | 85d01bca438180ef4ebd0ac6e6c4377c2f524197 (patch) | |
| tree | 1fe31c7dc26c6ffc1f7dacf0e336a854b1a71ca0 /gurg.sh | |
| parent | 3282fadecfdc8b32a1368e105cbf38ec717a0bc7 (diff) | |
| download | gurglesolver-85d01bca438180ef4ebd0ac6e6c4377c2f524197.tar.gz | |
gurg: helper for easier faceting
Diffstat (limited to 'gurg.sh')
| -rwxr-xr-x | gurg.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gurg.sh b/gurg.sh new file mode 100755 index 0000000..7c012e2 --- /dev/null +++ b/gurg.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +# $1: guessed word +# $2: .Abc. - A green, b, c yellow + +n2="$(echo $2 | tr [:upper:] .)" +has="./has.sh '${n2:0:1}' 1 |./has.sh '${n2:1:1}' 2 |./has.sh '${n2:2:1}' 3 |./has.sh '${n2:3:1}' 4 |./has.sh '${n2:4:1}' 5" +alias lc="tr [:upper:] [:lower:]" +l2="$(echo "$2" | lc)" + +cat - | +grep -v "[$(echo $1|tr -d "$l2")]" | +grep -i "$(echo $2|tr [:lower:] .)" | +sh -c "$has" |
