Heredoc
A here document, which is commonly shortened to heredoc is a multiline string literal syntax supported by multiple programming languages such as Bash, PHP, Ruby, etc.
It usually starts with <<
followed by some DELIMITER
. The string is closed when we reach the next occurrence of DELIMITER
.
Bash example π₯
base64 -d <<EOF
YWFhYQ==
EOF
PHP example π₯
$some_variable = <<<EOF
We can use both ' and ".
EOF;