bug-bash
[Top][All Lists]
Advanced

[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: Dennis Williamson
Subject: Re: Possible bug when combining Bash's process substitution with HERE-document?
Date: Thu, 19 Jun 2014 20:08:09 -0500

On Jun 19, 2014 5:00 PM, "Tim Friske" <address@hidden> 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 <address@hidden>:
> > On 6/18/14, 4:27 PM, Dan Douglas wrote:
> >> On Wed, Jun 18, 2014 at 2:49 PM, Chet Ramey <address@hidden>
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    address@hidden
http://cnswww.cns.cwru.edu/~chet/
>

Yes. Never use errexit. Use proper error handling.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]