mirror of
https://github.com/wezm/advent-of-code.git
synced 2024-11-14 11:38:01 +00:00
6 lines
173 B
Bash
6 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 }'
|