mirror of
https://github.com/wezm/advent-of-code.git
synced 2024-11-10 01:42:33 +00:00
8 lines
226 B
Bash
8 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 }'
|