Skip to content

Instantly share code, notes, and snippets.

@Ajnasz
Last active March 13, 2018 08:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ajnasz/91f055a6c6ae053fbb0660b937dc2d38 to your computer and use it in GitHub Desktop.
Save Ajnasz/91f055a6c6ae053fbb0660b937dc2d38 to your computer and use it in GitHub Desktop.
#!/bin/sh
# get clues
grep CLUE crimescene
# clue mentioned Annabel
grep Annabel people | \
cut -s -f 4 | \
cut -d ' ' -f1-2,4 | \
sed 's/ /_/' | \
sed 's/,//' | \
while read line;do
# n the streets file you can find a SEE INTERVIEW line
head -n `echo $line | cut -d' ' -f2` `echo streets/$line | cut -d' ' -f1` | tail -n 1 | sed 's/SEE INTERVIEW #//';
done | \
while read line;do
cat interviews/interview-$line;
done;
# Annabel were talking about a Blue Honda
# Other clue mentioned about a guy who is at least 6' tall
grep 'Honda' vehicles -A 4 -B 1 | grep 'Color: Blue' -B 2 -A 4 | \
grep 'L337.*9' -A 5 | grep 'Height: 6' -A 1 -B 5 | grep 'Owner' | cut -d ' ' -f2- | \
while read user;do
# Clue talking about membership, suspect must be member of all of the 4 groups
if [ "`grep "$user" memberships/AAA memberships/Museum_of_Bash_History memberships/Delta_SkyMiles memberships/Terminal_City_Library | wc -l`" -eq 4 ]; then
grep "$user" people;
fi;
done | \
# The guy has to be male
while read line;do
if [ "`echo $line | cut -d ' ' -f3`" = "M" ];then
echo $line | cut -d ' ' -f1,2
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment