mirror of
https://github.com/wezm/advent-of-code.git
synced 2024-11-14 11:38:01 +00:00
7 lines
226 B
Bash
7 lines
226 B
Bash
#!/bin/sh
|
|
|
|
awk -f day1.2.awk $1 | tr -d a-z | grep -o '^.' > first
|
|
rev $1 | awk -f day1.2.rev.awk | rev | tr -d a-z | grep -o '.$' > last
|
|
|
|
paste -d '\0' first last | \
|
|
awk 'BEGIN { sum = 0 } { sum += $0 } END { print sum }'
|