Re: Possible bug when combining Bash's process substitution with HERE-do
From:
Chet Ramey
Subject:
Re: Possible bug when combining Bash's process substitution with HERE-document?
Date:
Fri, 20 Jun 2014 10:31:40 -0400
User-agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.5.0
On 6/19/14, 6:00 PM, Tim Friske wrote:
> 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
You have constructed a command where `read' will wait forever for terminal
input and `true' will run with a here-document as its input. Change the
first line to
read -d '' -r foobar <<BARFOO || true
--
``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/