back to notes

heredoc heredocs bash sh shell

<<EOF: Doesn’t ignore leading tabs or spaces. The content within the heredoc is treated as-is, without any modifications.

<<'EOF' (Single-quoted heredoc): The single quotes around EOF prevent any variable substitution or command execution within the heredoc.

<<-EOF (Indented heredoc): The hyphen (-) after << allows for leading tabs to be ignored in the heredoc. It strips leading tabs from each line before processing.



last updated 17 hours ago