I'm getting a slightly different result when I run curl as a command than when I put its output in a variable and then read said variable.
1
x=`curl http://www.movies.com/rss-feeds/top-ten-box-office-rss 2> /dev/null`; echo $x
2
curl http://www.movies.com/rss-feeds/top-ten-box-office-rss 2> /dev/null
The differences between them are that when I do 2, I get everything and it is all formatted, and that, when I use option 1, besides being all one block, I miss all of the following (for each movie):
<pubDate>Tue, 04 Mar 2014 08:00:00 GMT</pubDate>
<source url="http://www.movies.com">Movies.com Top 10 Box Office</source>
</item>
<item>
<title><![CDATA[10. Ride Along - $2.0M]]></title>
I saw a similar question here (In ShellScript Assign Variable Based on Curl Output), but when I tried the proposed solution I get the same difference. Reading (and trying) flags doesn't help.
Apologies for the really beginner question.