How can I have a newline in a string in sh?
If you’re using Bash, the solution is to use $’string’, for example: If you’re using pretty much any other shell, just insert the newline as-is in the string: Bash is pretty nice. It accepts more than just \n in the $” string. Here is an excerpt from the Bash manual page: