[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bash-4.0 regression with here documents and multiline subshells
From: |
Mike Frysinger |
Subject: |
Re: bash-4.0 regression with here documents and multiline subshells |
Date: |
Thu, 26 Feb 2009 19:42:56 -0500 |
User-agent: |
KMail/1.11.0 (Linux/2.6.28; KDE/4.2.0; x86_64; ; ) |
On Thursday 26 February 2009 17:29:18 Chet Ramey wrote:
> Mike Frysinger wrote:
> > the documentation shows that for <<< here documents, the word must be
> > right after the operator (although it doesnt really spell it out). not
> > sure if that should be made explicit and to have bash reject it, or to
> > fix up this issue so it works again ...
> >
> > at any rate, this style usage, while seemingly not allowed by the docs,
> > works fine with older/current bash:
> > echo $(cat <<< "foo")
> >
> > however, when we go multiline, bash-4.0 gets into a parsing loop:
> > $ cat test.sh
> > #!/bin/bash
> > echo $(
> > cat <<< "foo"
> > )
> > $ ./test.sh
> > ./test.sh: line 2: unexpected EOF while looking for matching `)'
> > ./test.sh: line 5: syntax error: unexpected end of file
> >
> > if we go ahead and remove that whitespace after the <<<, then it works
> > fine: $ cat test.sh
> > #!/bin/bash
> > echo $(
> > cat <<<"foo"
> > )
> > $ ./test.sh
> > foo
>
> Problem with the $(...) parser not knowing the difference between << and
> <<<. The attached patch fixes it.
yep, and it fixes against the original large script. thanks!
-mike
signature.asc
Description: This is a digitally signed message part.