Why <<<$x
removes new line char?
> cat <<<"A
B" # prints two lines (as expected)
A
B
> x="A
B"
> cat <<<"$x" # prints two lines (again, as expected)
A
B
> cat <<<$x # prints one line (..Why only one line!? I would expected two lines, or just "A", or error; Who's eating up the new line?)
A B
How come did the new line disappear? Is it convenience thingy specially for <<<
?
Are there other situations where similar thing happen? (apart from <<<$var
)
Nothing relating to new lines in here: https://www.tldp.org/LDP/abs/html/x17837.html (if relevant: GNU bash, version 4.2.46(2)-release)