Top "Heredoc" questions

A Here-document is a special syntax of writing literal strings in sourcecode, used by different programming languages.

Use a variable within heredoc in PHP (SQL practice)

I'm a newbie to PHP/SQL and I am trying to use a variable within a heredoc as I need …

php sql variables heredoc
Python here document without newlines at top and bottom

What's the best way to have a here document, without newlines at the top and bottom? For example: print ''' …

python string printing heredoc
Multiline syntax for piping a heredoc; is this portable?

I'm familiar with this syntax: cmd1 << EOF | cmd2 text EOF but just discovered that bash allows me to …

bash shell pipe sh heredoc
How to avoid heredoc expanding variables?

I'm trying to create a script file using substitution string from ENV but want also to prevent some from escaping …

bash escaping substitution heredoc
How do I remove leading whitespace chars from Ruby HEREDOC?

I'm having a problem with a Ruby heredoc i'm trying to make. It's returning the leading whitespace from each line …

ruby whitespace heredoc
Bash: warning: here-document at line delimited by end-of-file (wanted `EOF')

The following function in bash comes up with the error mentioned in the title. The error usually appears when the …

bash eof heredoc
Advantages / inconveniences of heredoc vs nowdoc in php

As a newbie, I have been advised to preferably use heredoc compared to too many nested codes (see Unexpected T_…

php heredoc nowdoc
heredoc for Windows batch?

Is there a way of specifying multiline strings in batch in a way similar to heredoc in unix shells. Something …

templates batch-file heredoc
What is <<<_END?

I'm new to PHP and don't understand what the point of <<<_END is. Could someone please explain …

php heredoc