Inserting
\n
p="${var1}\n${var2}" echo -e "${p}"
Inserting a new line in the source code
p="${var1} ${var2}" echo "${p}"
Using
$'\n'
(only Bash and Z shell)p="${var1}"$'\n'"${var2}" echo "${p}"
from: https://stackoverflow.com/questions/9139401/trying-to-embed-newline-in-a-variable-in-bash
No comments:
Post a Comment