Shell Scripting Knowledge Base
heredoc
NOTES 1, 2
Note that the final 'EOF' (The LimitString) should not have any whitespace in front of the word, because it means that the LimitString will not be recognized.
In a shell script, you may want to use indentation to make the code readable, however this can have the undesirable effect of indenting the text within your here document. In this case, use <<-
(followed by a dash) to disable leading tabs (Note that to test this you will need to replace the leading whitespace with a tab character, since I cannot print actual tab characters here.)
HereDoc can be used to d that does not return any value. Follow the steps below to use Bash HereDoc to disable multiple lines of code in a script.
Disable script content with the dummy command :
#!/bin/bash echo "Hello World! This Works!" : <<'EOF' echo "Hello User! This is disabled!" EOF echo "This runs"