Skip to content
Advertisement

Bash – How to print multi line strings (with ‘n’) using printf

i’m trying to print a multi line strings in printf this way

JavaScript

I can’t do the following

JavaScript

Is there any other way?

Advertisement

Answer

Quoting the variable should do the trick. In your example, however, you are getting double newlines.

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement