June 2025
Beginner to intermediate
473 pages
13h 30m
English
Bash can’t handle XML documents any more than it can handle JSON files. A possible workaround in this context is external commands, but these commands must be installed separately. On Linux, you can use the package management tools for your distribution, while on macOS the best choice is to use Homebrew.
The xmllint command displays XML documents with indentations in a readable way and verifies their compliance with XML syntax rules. If an XML file cannot be edited at all, a short test using xmllint is appropriate. On macOS, the command is installed by default, but on Linux, the command is hidden in different packages, depending on the distribution:
$ sudo apt install libxml2-utils (Debian, Ubuntu)$ sudo ...
Read now
Unlock full access