i’m trying to print a multi line strings in printf
this way
JavaScript
x
printf "hin"
printf "next line heren"
I can’t do the following
JavaScript
text_content="
hi
next line here
"
printf $text_content
Is there any other way?
Advertisement
Answer
Quoting the variable should do the trick. In your example, however, you are getting double newlines.
JavaScript
printf "$text_content"