Adding a newline to AWS SNS message in a shell script


I want to send AWS SNS notification through shell script in EC2. The following is my command:

My problem is that I don’t know how can I insert a newline before I printing the content of file using “cat” command? I want to print the content of the file after a newline. Now it gets appended to "The file contents of ...".

How do I add a newline into the --message parameter?


Inserting the literal newline character

In Bash/Ksh93/Zsh:

\n'"$(cat ${error_file})" \
# other options
Using printf:

Leave a Reply