Use -e
option, then you can print new line character with \n
in the string.
Sample (but not sure whether a good one or not) For example:
The fun thing is that -e
option is not documented in MacOS's man page while still usable. It is documented in the man page of Linux.
echo -e "This will be the first line \nand this will be on the second line"