On Sun, Jul 07, 2024 at 10:43:45PM -0400, Eric Sunshine wrote: > This one made me think of an additional pathological case, though I'm > not sure it's worth having a test: > > test_expect_success 'pathological-here-doc-body' - <<\EOF > echo "missing chain before" > cat >file <<-\EOF && > inside inner here-doc > these are not shell commands > EOF > echo "missing chain after" > echo "but this line is OK because it's the end" > EOF > > It's exactly the same as your test except that the same tag ("EOF") is > used for both outer and inner heredocs. It works because the outer > heredoc is introduced with `<<` whereas the inner with `<<-`. The > opposite case, in which outer is introduced with `<<-` and inner with > `<<`, obviously would be bogus. Ooh, that's devious. I'll add it. -Peff