Skip to content

Instantly share code, notes, and snippets.

@trescenzi
Created February 18, 2022 16:26
Show Gist options
  • Save trescenzi/5a174c3e143aac335ae67a21de27bb9c to your computer and use it in GitHub Desktop.
Save trescenzi/5a174c3e143aac335ae67a21de27bb9c to your computer and use it in GitHub Desktop.
#! /bin/bash
read -p "Letters to exclude: " exclude
exclude=${exclude:-/\d}
read -p "First Letter[.]: " first
first=${first:-.}
read -p "Second Letter[.]: " second
second=${second:-.}
read -p "Third Letter[.]: " third
third=${third:-.}
read -p "Fourth Letter[.]: " fourth
fourth=${fourth:-.}
read -p "Fifth Letter[.]: " fifth
fifth=${fifth:-.}
read -p "Anything else? " unknown
unknown=${unknown:-(a-z)}
words=`grep [^$exclude][^$exclude][^$exclude][^$exclude][^$exclude] $HOME/scripts/5letterwords.txt | grep $first$second$third$fourth$fifth | grep [$unknown]`
echo $words
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment