Given this file
$ cat foo.txt
\"That's funny, haha\"
I can unescape the double quotes with read
$ read bar < foo.txt
$ echo $bar
"That's funny, haha"
However can this be done with a pipe? Something like
cat foo.txt | unescape
This seems to do it
sed -r 's/\\(.)/\1/g'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With