[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] Does the parser backtrack?
From: |
Dan Douglas |
Subject: |
Re: [Help-bash] Does the parser backtrack? |
Date: |
Tue, 18 Oct 2016 13:57:10 -0500 |
On Tue, Oct 18, 2016 at 11:52 AM, Dan Douglas <address@hidden> wrote:
> Needless to say, a reasonable person would write something like this
> instead:
>
> $( (foo <<EOH1) && foo <<EOH2)
> + ( (
> EOH1
> ) ) + 1 +
> EOH2
Oh I guess the ash derivatives are unusual in this particular case.
Most shells want their heredoc delimited within the command
substitution. Oh well, reinforces my point that $(... <<DOC) is so
useless that I never use them like this. I'd normally do:
{ x=$( (cat) && cat <&3); } <<\EOH1 3<<\EOH2
+ ( (
EOH1
) ) + 1 +
EOH2
...multi-line command substitutions are easier this way too.