How To Use Multi Line String In Shell

Check Date

Works on 2019-03-19 15:10:28+0800 System Version macOS 10.13.6

Question

How to use Multi-line string in Shell ?

Answer

cat << EndOfMessage

This is line 1.

This is line 2.

Line 3.

EndOfMessage

The string after ’<<’ indicates where to stop.

Reference

Published 19 Mar 2019

Bring the answer to lost vistor
MagicRabbit on Twitter