bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bash 5.1 heredoc pipes problematic, shopt needed


From: Sam Liddicott
Subject: Re: bash 5.1 heredoc pipes problematic, shopt needed
Date: Sun, 24 Apr 2022 21:27:59 +0100

Thanks for that important context.

Chet Ramey once said:
> One can argue that the concerns on either side (seeking on stdin vs.
> assuming that here-strings will never hit the file system) are assumptions
> that should not be made,

In reality no-one is making such an assumption, neither idea enters their
head, nor do they assume anything about whether a called program will or
will not redundantly stat the "file" name to check that it is a file.

What they do assume is that what worked with bash 5.0 will keep working
with minor revision 5.1

This is going to keep coming up.

Sam

On Sun, 24 Apr 2022, 21:11 Lawrence Velázquez, <vq@larryv.me> wrote:

> > On Apr 24, 2022, at 3:41 PM, Oğuz <oguzismailuysal@gmail.com> wrote:
> >
> > 24 Nisan 2022 Pazar tarihinde Ángel <angel@16bits.net> yazdı:
> >>
> >> I think a shopt makes more sense. Forcing heredocs to be files although
> >> something legit to request, is more a caller workaround to bugs in
> >> called programs.
> >>
> >
> > https://lists.gnu.org/archive/html/bug-bash/2020-12/msg00084.html
>
>
> Oh yeah, I remember this.  Here is Chet's position at the time:
>
> https://lists.gnu.org/archive/html/bug-bash/2020-12/msg00085.html
>
>
> Begin forwarded message:
>
> > From: Chet Ramey <chet.ramey@case.edu>
> > Subject: Re: Is there a way to force here-documents/strings to use
> temporary files?
> > Date: December 20, 2020 at 3:53:32 PM EST
> > To: Oğuz <oguzismailuysal@gmail.com>, bug-bash <bug-bash@gnu.org>
> > Cc: chet.ramey@case.edu
> > Reply-To: chet.ramey@case.edu
> >
> > On 12/20/20 2:25 AM, Oğuz wrote:
> >
> >> So, is there any way to force here-documents to use temporary files no
> >> matter how long the expanded document is? If not, it would be nice if
> >> compat50 had this effect.
> >
> > There is not. I'm not sure that a compat setting would be appropriate for
> > something that is purely an implementation issue.
> >
> > There was a fairly extensive discussion that preceded this change,
> starting
> > with
> >
> > https://lists.gnu.org/archive/html/bug-bash/2019-03/msg00073.html
> >
> > and continuing the next month (!) with
> >
> > https://lists.gnu.org/archive/html/bug-bash/2019-04/msg00007.html
> >
> > One can argue that the concerns on either side (seeking on stdin vs.
> > assuming that here-strings will never hit the file system) are
> assumptions
> > that should not be made, for instance
> >
> > https://lists.gnu.org/archive/html/bug-bash/2019-03/msg00075.html
> > or
> > https://lists.gnu.org/archive/html/bug-bash/2019-03/msg00082.html
> >
> > I decided ultimately to make the change for the most common cases, where
> > the amount of data passed in a here string or here document is small. But
> > that is simply an implementation detail; the documented semantics of
> here-
> > documents and here-strings aren't changed.
> >
> > --
> > ``The lyf so short, the craft so long to lerne.'' - Chaucer
> >                ``Ars longa, vita brevis'' - Hippocrates
> > Chet Ramey, UTech, CWRU    chet@case.edu
> http://tiswww.cwru.edu/~chet/
>
>
> --
> vq


reply via email to

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