var1=$(printf "\n\x0A\n")
var2=$(printf "\na\nb\nc")
Using Android Terminal, the output of echo -e "$var1"
(same for echo and printf) iss nothing, not even the 3 new lines. But echo -e "$var2"
or echo "$var2"
or printf "$var2"
output:
a
b
c
How come $var2's output includes the whitespace character but not $var1?
(\n
and \x0A
have the exact same behaviour.)
=
sign between double quotes – wurtel May 10 '19 at 10:53echo
inserts a newline after the output, butprintf
does not. – Seamus May 10 '19 at 13:20