I would have put my small addition in a comment on the answer of cYrus, but I cannot yet comment on answers I think. So I'll duplicate part of cYrus his answer for completeness.
What happens in the first line of your code is that indeed the backticks substitution eats the trailing newlines of the output of the substituted command, as documented. But it does not eat the newline between your two lines.
What happens in the second line of code is that echo is executed with two arguments, the first and the second line. Quoting the expanded variable will fix that:
echo "$var" This will preserve the newline between your line one and line two. And
echo will add a trailing newline by default so that everything is okay.
Now if you wanted to preserve all trailing newlines in the output of some command substitution, a workaround is to add another line the output, which you can remove after the command substitution, see here .