mirror of
https://github.com/wezm/advent-of-code.git
synced 2024-12-18 18:29:55 +00:00
7 lines
173 B
Bash
7 lines
173 B
Bash
|
#!/bin/sh
|
||
|
|
||
|
tr -d a-z < $1 | grep -o '^.' > first
|
||
|
tr -d a-z < $1 | grep -o '.$' > last
|
||
|
paste -d '\0' first last | \
|
||
|
awk 'BEGIN { sum = 0 } { sum += $0 } END { print sum }'
|