In bash, newlines are saved using command substitution:
$ TEST="$(echo 'a
b
c
')" && echo "$TEST"
a
b
c
However, when I try to do the same in a fish shell, newlines are converted to spaces:
$ set TEST (echo "a
b
c
"); and echo "$TEST"
a b c
How to make fish save newlines as newlines?
source
share