diff options
| author | Zach DeCook <zachdecook@librem.one> | 2021-10-09 05:55:05 -0400 |
|---|---|---|
| committer | Zach DeCook <zachdecook@librem.one> | 2021-10-09 05:55:05 -0400 |
| commit | bed91ca620bb0c4efeea2aceaaae19ab510b53da (patch) | |
| tree | 5c9665827139ca878d5d7d3495105254560d1c10 /swipeGuess.sh | |
| download | swipeGuess-bed91ca620bb0c4efeea2aceaaae19ab510b53da.tar.gz | |
swipeGuess.sh: script to turn swip into a list of guesses
Diffstat (limited to 'swipeGuess.sh')
| -rwxr-xr-x | swipeGuess.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/swipeGuess.sh b/swipeGuess.sh new file mode 100755 index 0000000..53fc4b4 --- /dev/null +++ b/swipeGuess.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +swipeToQuery(){ + swipe=$1 + printf '^' + printf ${swipe:0:2} + if test "${swipe:2}"; then + printf "${swipe:2}" |grep -o . | xargs printf '\?%s' + fi + printf '$' +} + +wordlist="$2" + +query=$(swipeToQuery $1) +echo "query: $query" > /dev/stderr +grep $query "$2" |
