On Jun 19, 2014 5:00 PM, "Tim Friske" <m...@timfriske.com> wrote: > > 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.ra...@case.edu>: > > On 6/18/14, 4:27 PM, Dan Douglas wrote: > >> On Wed, Jun 18, 2014 at 2:49 PM, Chet Ramey <chet.ra...@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 c...@case.edu http://cnswww.cns.cwru.edu/~chet/ >
Yes. Never use errexit. Use proper error handling.