Trying to read .xml file from another server into a variable
test=$(ssh root@server "cat /dir/file.xml")
But when doing
echo $test, it prints the .xml file in one-liner format.
Then trying to execute
xmllint on this file,
and getting the following error on each tag.
warning: failed to load external entity "..."
Note: when doing the same procedure, but on local .xml file(without
ssh), it's working and getting the expected result.
Any way to solve this? Or use
xmllint tool remotely?