How to print new line character with echo?
Posted
by
Summer_More_More_Tea
on Super User
See other posts from Super User
or by Summer_More_More_Tea
Published on 2012-07-02T13:27:37Z
Indexed on
2012/07/03
3:20 UTC
Read the original article
Hit count: 222
I dump a string with hexdump
like this 2031 3334 2e30 0a32 2032 3331 302e 000a
. It is clear that 0x0a
is new line character, however, when I try to echo this string out, I always got 1 430.2 2 13.0
-- the new line is replaced with a space, even I use the -e
flag.
What may be the problem? Does the tailing \0
ruin the output? Is there any alternatives to print 0x0a
a new line?
Thanks and Best regards.
© Super User or respective owner