Skip to content

Instantly share code, notes, and snippets.

@roblogic
Last active October 12, 2020 05:22
Show Gist options
  • Save roblogic/e465acabb57c8a83671ed4d02a2d2f5e to your computer and use it in GitHub Desktop.
Save roblogic/e465acabb57c8a83671ed4d02a2d2f5e to your computer and use it in GitHub Desktop.
pattern matcher for doing simon shuker's code-cracker in the nz herald. ".txt" uses data from https://github.com/dolph/dictionary/blob/master/unix-words
#!/bin/sh
[ "$1" ] || { echo "pattern?"; exit; }
patt="$1"
grep -E "^$patt$" *.txt | awk -F: '{print $2}'| sort -u | paste - - - - -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment