This seems very easy (and it probably is), but I'm having some problems with saving a result of a pipe to a variable.
Let's say this is the output of the pipe:
This
is
the
output
of
the
pipe
Which look exactly as I want. However, if I try to store the pipe into variable:
var=$(...pipe...)
The output of the echo $var will be:
This is the output of the pipe
Also tried with printf, but it doesn't work either.