Unescape with pipe

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

Answers


This seems to do it

sed -r 's/\\(.)/\1/g'

Need Your Help

Sort a multidimensional array by date php

php sorting date multidimensional-array

I have an array [all_comments] which contains 3 arrays - [title], [content] and [date].

Why PDO does not bind my params?

php pdo parameters bind defined

I have a query with some parameters that I bind with PDO. This is my code:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.