++

On Sun, Mar 16, 2025, 12:10 AM MacBeth <macbeth.112...@gmail.com> wrote:

> On Sat, Mar 15, 2025 at 12:33 PM Greg Wooledge <g...@wooledge.org> wrote:
> > On Sat, Mar 15, 2025 at 16:14:00 +0000, Nikola Novak via Bug reports for
> the GNU Bourne Again SHell wrote:
> > > How do you end the heredoc with a multiline delimiter such as the
> following:
> > >
> > > cat << "a
> > > b"
> >
> > You don't.
> >
>
> However you could fake it, by including backslashes in the delimiter,
> which would allow literal newlines, but bash would ignore them as they
> are escape sequences. So they wouldn't actually be a part of the
> delimiter from bash's perspective, but merely visually and accepted
> from the literal input.
>
> $ cat <<EOT\
> $ EOF
> $ hello
> $ goodbye
> $ EOT\
> $ EOF
> hello
> goodbye
> $
>
>

Reply via email to