Top "Heredoc" questions

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

Creating multiline strings in JavaScript

I have the following code in Ruby. I want to convert this code into JavaScript. what's the equivalent code in …

javascript string multiline heredoc
How does "cat << EOF" work in bash?

I needed to write a script to enter multi-line input to a program (psql). After a bit of googling, I …

linux bash scripting heredoc
How can I write a heredoc to a file in Bash script?

How can I write a here document to a file in Bash script?

bash heredoc
How to cat <<EOF >> a file containing code?

I want to print code into a file using cat <<EOF >>: cat <<EOF >&…

linux unix sh heredoc
How to assign a heredoc value to a variable in Bash?

I have this multi-line string (quotes included): abc'asdf" $(dont-execute-this) foo"bar"'' How would I assign it to a variable …

bash heredoc
Executing multi-line statements in the one-line command-line?

I'm using Python with -c to execute a one-liner loop, i.e.: $ python -c "for r in range(10): print 'rob'" …

python shell command-line heredoc
What is the advantage of using heredoc in PHP?

What is the advantage of using heredoc in PHP, and can you show an example?

php heredoc
here-document gives 'unexpected end of file' error

I need my script to send an email from terminal. Based on what I've seen here and many other places …

bash email heredoc
Using variables inside a bash heredoc

I'm trying to interpolate variables inside of a bash heredoc: var=$1 sudo tee "/path/to/outfile" > /dev/null <&…

bash variables sh heredoc
Javascript heredoc

I need something like heredoc in JavaScript. Do you have any ideas for this? I need cross-browser functionality. I found …

javascript heredoc