Created
February 20, 2020 17:15
-
-
Save rhowe/8bca5487d4e1ed1dcaec109096e83e41 to your computer and use it in GitHub Desktop.
AOC2019day4part2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eu | |
set -o pipefail | |
thisisfine=$(seq 0 9 | sed 's/.*/^&&[^&]|[^&]&&[^&]|[^&]&&$/' | xargs | tr \ \|) | |
seq "${1%-*}" "${1#*-}" \ | |
| grep -Ev '10|2[01]|3[0-2]|4[0-3]|5[0-4]|6[0-5]|7[0-6]|8[0-7]|9[0-8]' \ | |
| grep -cE "$thisisfine" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment