day 14 semi-golf, with missing fifth glyph
[aoc_eblake.git] / 2015 / advent16.sh
blob6ba146baf4bb7d2008de419ea590fe3ce1c9eed4
1 while read line; do
2 if [[ $line =~ 'children: '([0-9]+) ]]; then
3 [[ ${BASH_REMATCH[1]} == 3 ]] || continue
4 fi
5 if [[ $line =~ 'cats: '([0-9]+) ]]; then
6 [[ ${BASH_REMATCH[1]} -gt 7 ]] || continue
7 fi
8 if [[ $line =~ 'samoyeds: '([0-9]+) ]]; then
9 [[ ${BASH_REMATCH[1]} == 2 ]] || continue
11 if [[ $line =~ 'pomeranians: '([0-9]+) ]]; then
12 [[ ${BASH_REMATCH[1]} -lt 3 ]] || continue
14 if [[ $line =~ 'akitas: '([0-9]+) ]]; then
15 [[ ${BASH_REMATCH[1]} == 0 ]] || continue
17 if [[ $line =~ 'vizslas: '([0-9]+) ]]; then
18 [[ ${BASH_REMATCH[1]} == 0 ]] || continue
20 if [[ $line =~ 'goldfish: '([0-9]+) ]]; then
21 [[ ${BASH_REMATCH[1]} -lt 5 ]] || continue
23 if [[ $line =~ 'trees: '([0-9]+) ]]; then
24 [[ ${BASH_REMATCH[1]} -gt 3 ]] || continue
26 if [[ $line =~ 'cars: '([0-9]+) ]]; then
27 [[ ${BASH_REMATCH[1]} == 2 ]] || continue
29 if [[ $line =~ 'perfumes: '([0-9]+) ]]; then
30 [[ ${BASH_REMATCH[1]} == 1 ]] || continue
32 echo $line
33 done