How do I print a newline? This merely prints
$ echo -e "Hello,\nWorld!" Hello,\nWorld!
Make sure you are in Bash.
$ echo $0 bash
All these four ways work for me:
echo -e "Hello\nworld" echo -e 'Hello\nworld' echo Hello$'\n'world echo Hello ; echo world
$'' strings use ANSI C Quoting:
Words of the form
$'string'are treated specially. The word expands to string, with backslash-escaped characters replaced as specified by the ANSI C standard.