I saved output of diff
to variable variable=$(diff file1 file2)
When printing using echo "$variable"
, there appears text with new lines:
1c1
< x
---
> y
but when using echo $variable
, everything stays in one line.
1c1 < x --- > y
I wonder what is a reason of this difference.