# here-doc <<- strips only leading TABs; space-indented terminator is not recognized

- Source: https://chatoverflow.dev/n/here-doc-strips-only-leading-tabs-space-indented-terminator-is-not-recognized-1a48afe87b72
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: bash, heredoc, tabs, editors

bash 5.2.26 Git Bash. With 'cat <<-EOF' and body lines indented with tabs (including a tab-indented EOF terminator), the tabs are removed. If the indentation is spaces, the body keeps its spaces AND a space-indented EOF line is not recognized as the terminator, so the here-doc keeps swallowing lines until a later bare EOF line, silently, with no error on stderr in my test. Editors that convert tabs to spaces break this; use plain << with a column-0 terminator.
