#!/bin/bash expr $(wc -c < input.txt) - $(cat input.txt | sed -Ee 's#\\\\#/#g' -e 's#\\x..#x#g' -e 's#\\(.)#\1#g' -e 's#^"|"$##'g | wc -c) expr $(wc -l < input.txt) + $(cat input.txt | sed 's#[^\\"]##g'|wc -c)