0

I was under the impression that this:

  cat <<- TEXT
    Hello
    there
  TEXT

was supposed to work and would output:

Hello
there

Instead, it seems to be ignoring the end delimiter. Even doing this:

  cat <<- TEXT
    Hello
    there
TEXT

Result in:

    Hello
    there

with the leading whitespace still there. Am I doing something wrong or is this a bug?

This question is different from the others because although they do answer the question, they don't answer it directly. I would be better off going to the man page and reread it until I find the part that I missed.

Adrian
  • 10,246
  • 4
  • 44
  • 110
  • 1
    With `<<-` only leading tabs are ignored. – Cyrus Nov 20 '22 at 16:32
  • ‍♂️I had assumed horizontal whitespace. Thx @Cyrus. I don't use tabs anymore for indenting. I'll just pipe it through `sed`. – Adrian Nov 20 '22 at 16:37
  • You already answered the question @Cyrus. If you want, post an answer and I'll accept it. – Adrian Nov 20 '22 at 18:17
  • I suggest to close this question with a duplicate. – Cyrus Nov 20 '22 at 19:06
  • They answer, but very indirectly @Cyrus. I could have gotten that from reading the man page, but I just missed it. I don't think that this is a duplicate. – Adrian Nov 20 '22 at 19:27
  • Added "Leading heredocs with spaces" to the duplicate list; I think that one's a bit more narrowly on-point. – Charles Duffy Nov 20 '22 at 19:32

0 Answers0