Re: [PATCH v2 1/8] git-prompt: use here-doc instead of here-string
- From
avih <avihpit@yahoo.com>
- Date
- Aug 16, 2024, 09:37 UTC
- Message-ID
- <1407516636.4490130.1723801035574@mail.yahoo.com>
- In-Reply-To
- <Zr8Sv9xZrdf6rHgg@tanuki>
On Friday, August 16, 2024 at 11:50:12 AM GMT+3, Patrick Steinhardt <ps@pks.im> wrote:
Show 10 quoted lines
> On Thu, Aug 15, 2024 at 01:14:06PM +0000, Avi Halachmi (:avih) via GitGitGadget wrote: >> - done <<< "$output" >> + done <<-OUTPUT >> + $output >> + OUTPUT > > I was a bit sceptical at first whether this produces the correct output, > because I wasn't sure whether the first line might be indented while the > others wouldn't be. And that would only happen if we indented with > spaces, but when indenting with a tab it seems to work as expected.
That's what the "-" does in "<<-". It strips leading input tab chars at the content and the last line, and was specified as such since the first POSIX release in 1994:
If the redirection symbol is <<−, all leading tab characters will be stripped from input lines and the line containing the trailing delimiter.