bug-bash
[Top][All Lists]
Advanced

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

Re: "here strings" and tmpfiles


From: konsolebox
Subject: Re: "here strings" and tmpfiles
Date: Mon, 25 Mar 2019 03:13:07 +0800

On Tue, Mar 19, 2019, 9:36 PM Greg Wooledge <address@hidden> wrote:

> On Tue, Mar 19, 2019 at 09:20:33AM -0400, Daniel Kahn Gillmor wrote:
> > On Tue 2019-03-19 08:25:50 -0400, Greg Wooledge wrote:
> > > On Mon, Mar 18, 2019 at 05:18:10PM -0400, Daniel Kahn Gillmor wrote:
> > >>     strace -o tmp/bash.herestring.strace -f bash -c 'cat <<<"hello
> there"'
> > >> It turns out that this creates a temporary file, actually touching the
> > >> underlying filesystem:
> > >
> > > Yes, just like here documents do.  And have always done, in all shells.
> >
> > Apologies for being unaware of the history.  It looks like there are a
> > handful of possible approaches today that minimize these fixes, which
> > may not have been possible on older systems, which i listed upthread.
> > And they work on arbitrary file descriptors, not just stdin.
> >
> > Do you think that bash should not improve the situation, at least on
> > platforms that support these other approaches?
>
> There are scripts that *rely* on the seekability of the temporary files
> created by here-documents and here-strings.  "Improving" the "situation"
> would break backward compatibility.
>

That's broken practice. They should use a real temporary "file" explicitly
if they want seekability.

-- konsolebox


reply via email to

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