Bash script to convert from HTML entities to characters

Marko picture Marko · May 8, 2011 · Viewed 50.5k times · Source

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?

Answer

ceving picture ceving · May 8, 2011

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