day 5 part 2
[aoc_eblake.git] / 2015 / advent8.sh
blob0c3aede0db4d3940a1f00c9ca46ee7c508e20565
1 [[ $# == 1 ]] || { echo "missing filename"; exit 1; }
2 echo $(( $(wc -c < $1) -
3 $(sed 's/\\[\"]/B/g; s/\\x../?/g; s/^"//; s/"$//' < $1 | wc -c) ))
4 echo $(( $(sed 's/[\"]/\\\\/g; s/^/"/; s/$/"/' < $1 | wc -c) - $(wc -c < $1) ))