Syntax
<<- prefix strips leading whitespace from every line, so you can indent the content to match the surrounding code without affecting the shell command.
The closing marker (EOT in the example) must be on its own line. You can use any identifier as the marker, but EOT is conventional.
Example
Run a conditional check inline:Multiple heredocs in a single task
Each command in the list is independent. You can mix regular strings and heredocs:Interpolation in heredocs
${} interpolation works inside heredocs:
${} to the shell (instead of evaluating it as an Errand expression), escape the dollar sign:
Notes
- The content of a heredoc is a single string passed to the shell interpreter. The shell processes it as one script, not line by line.
- Trailing newlines are preserved. Use
chomp()if you need to strip them in an expression context.