Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bash script to convert from HTML entities to characters

I'm looking for a way to turn this:

hello < world 

to this:

hello < world 

I could use sed, but how can this be accomplished without using cryptic regex?

like image 439
Marko Avatar asked May 08 '11 18:05

Marko


1 Answers

Try recode (archived page; GitHub mirror; Debian page):

$ echo '&lt;' |recode html..ascii < 

Install on Linux and similar Unix-y systems:

$ sudo apt-get install recode 

Install on Mac OS using:

$ brew install recode 
like image 55
ceving Avatar answered Sep 20 '22 23:09

ceving