I am working with scripts that output xml and I am using xmllint to format the output. Xmllint requires a source argument, so I use the hyphen to pipe standard output to it:
$> script.php source.txt | xmllint --format - > nice_output.xml
Since I run these scripts quite a bit, I would like to turn the
xmllint --format - part into a single command that I can pipe into, but I am not sure how to even start. I would like to do this:
$> script.php source.txt | nicexml > nice_output.xml
nicexml is my custom command/alias. How do I do this?