[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Possible bug when combining Bash's process substitution with HERE-do
From: |
Tim Friske |
Subject: |
Re: Possible bug when combining Bash's process substitution with HERE-document? |
Date: |
Fri, 20 Jun 2014 00:00:02 +0200 |
Hi,
first I want to thank you for your help.
While searching for an alternative I came up with the following code
which does not work when I have the "shopt -os errexit" command line
at the top of my script:
read -d '' -r foobar <<BARFOO
bla bla
BARFOO
When I try to explicitly return success in case read fails because of
EOF the script indefinitely waits:
read -d '' -r foobar || true <<BARFOO
bla bla
BARFOO
Do you know a solution?
Cheers
Tim
2014-06-18 22:35 GMT+02:00 Chet Ramey <chet.ramey@case.edu>:
> On 6/18/14, 4:27 PM, Dan Douglas wrote:
>> On Wed, Jun 18, 2014 at 2:49 PM, Chet Ramey <chet.ramey@case.edu> wrote:
>>> Yes, since bash can parse the same construct without any problems if you
>>> use command substitution, it looks like a bug. I'll take a look.
>>
>> It brings to mind all those unbalanced paren case..esac bugs that
>> affected every shell ever.
>> I suppose this might qualify as a bug too?
>
> Yes, with the same fix.
>
> Chet
>
> --
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
> ``Ars longa, vita brevis'' - Hippocrates
> Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/