Bash script to convert from HTML entities to characters

前端 未结 10 625
悲哀的现实
悲哀的现实 2020-12-02 09:59

I\'m looking for a way to turn this:

hello < world

to this:

hello < world

I could use sed, but

10条回答
  •  离开以前
    2020-12-02 10:13

    A python 3.2+ version:

    cat foo.html | python3 -c 'import html, sys; [print(html.unescape(l), end="") for l in sys.stdin]'
    

提交回复
热议问题