This is what console outputs when I execute cURL directly from the terminal:
/# curl -ksi http://localhost/
HTTP/1.1 302 Moved Temporarily
Server: nginx/1.6.2
Date: Sun, 14 Jan 2018 11:49:38 GMT
Content-Type: text/html
Content-Length: 160
Connection: keep-alive
Location: http://localhost/welcome/default
Cache-Control: private, max-age=0
<html>
<head><title>302 Found</title></head>
<body bgcolor="white">
<center><h1>302 Found</h1></center>
<hr><center>nginx/1.6.2</center>
</body>
</html>
But if I try to save the output of the cURL to a variable the content of it ends up looking corrupted:
/# VAR=`curl -ksi http://localhost/`
/# echo $VAR
</html>nter>nginx/1.6.2</center>er>d>fault
What is it that I am doing wrong in this case?