Skip to content

Instantly share code, notes, and snippets.

@jarryDk
Last active June 22, 2021 09:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jarryDk/9d7765a51a89acd4bfa23db9a7a6558f to your computer and use it in GitHub Desktop.
Save jarryDk/9d7765a51a89acd4bfa23db9a7a6558f to your computer and use it in GitHub Desktop.
Nice format xml via script
#!/bin/bash
# Link: https://stackoverflow.com/questions/16090869/how-to-pretty-print-xml-from-the-command-line#16090892
#
# This utility comes with libxml2-utils: https://gitlab.gnome.org/GNOME/libxml2
#
echo '<root><foo a="b">lorem</foo><bar value="ipsum" /></root>' |
xmllint --format -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment