I need to output two digits each on a line. The result should be:
1
2
I tried different approaches and have seen the SO question "Echo newline in Bash prints literal \n".
I do understand this outputs:
bash> echo "1\n2"
1\n2
bash> echo -e "1\n2"
1
2
But what's going on here?
bash> sh -c echo "1\n2"
bash> sh
$ echo "1\n2"
1
2
$ exit
bash>
My shell is /bin/bash
: GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)
sh is linked to /bin/dash
: