summaryrefslogtreecommitdiffstats
path: root/8/solution.sh
blob: 5b227ec1a77a39168bd0049fdf7fe22c30cb97cc (plain)
1
2
3
4
5
rawlen=$(while read -r; do printf "${REPLY:1:-1}"; done <$1 | wc -c)
reallen=$(<$1 tr -d '\n' | wc -c)
echo $((reallen - rawlen))
quotedlen=$(sed 's/["\\]/\\&/g;s/.*/"&"/' $1 | tr -d '\n' | wc -c)
echo $((quotedlen - reallen))