Skip to content

Instantly share code, notes, and snippets.

@payne
Forked from apettenati/clmystery.sh
Created February 18, 2021 21:47
Show Gist options
  • Save payne/a7722194fa899f97e84bd3fd9263cd4d to your computer and use it in GitHub Desktop.
Save payne/a7722194fa899f97e84bd3fd9263cd4d to your computer and use it in GitHub Desktop.
Command Line Mystery
# Note: I use ripgrep (rg) to search which searches recursively and supports regex -A and -B return rows after/before search results
git clone https://github.com/veltman/clmystery
cd clmystery
cat instructions
cd mystery
# Search for clues and save to file
cat crimescene | rg CLUE > clues.txt
# Search for Annabel in people
rg Annabel people
# Search for 3 Annabel names in interviews
# Clue on 3rd line of interview-699607
rg "Church|Sun|Fuglsang" interviews -A 5
# Search for Blue Hondas with a license plate starting with L337 and ending with 9
rg "L337\S\S9" vehicles -A 5 | rg Blue -A 5 -B 2 | rg Honda -A 5 -B 1 > suspects.txt
# Check gender and remove F and people below 6'
rg "Erica Owens|Aron Pilhofer|Heather Billings|Joe Germuska|Jeremy Bowers|Jacqui Maher" people
# Joe and Jeremy are only remaining suspects - find out what memberships they hold
rg "Joe Germuska|Jeremy Bowers" memberships
# Joe does not have Delta SkyMiles or Museum of Bash History card!!
cd ..
echo "Jeremy Bowers" | $(command -v md5 || command -v md5sum) | grep -qif /dev/stdin encoded && echo CORRECT\! GREAT WORK, GUMSHOE. || echo SORRY, TRY AGAIN.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment