Escape special XML characters from stdin

xml escape

  • Escape special XML characters, e.g. `<a1>` → `&lt;a1&gt;`.
    More information: <http://xmlstar.sourceforge.net/doc/xmlstarlet.pdf>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

echo "{{<a1>}}" | xml escape

click the source code to copy install xml escape on any operating system with command-not-found.com