aboutsummaryrefslogtreecommitdiff
path: root/2024/03/puzzle-1.sh
blob: c0f2f3852091d5d2a7d1eadb9e3f1262feb685e5 (plain) (blame)
1
2
3
4
5
6
7
#!/bin/sh

grep -Eo 'mul\([0-9]+,[0-9]+\)' input \
| awk 'BEGIN { FPAT = "[0-9]+" }
             { x += $1 * $2 }
       END   { print x }
'