bug-bash
[Top][All Lists]
Advanced

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

Re: "here strings" and tmpfiles


From: pepa65
Subject: Re: "here strings" and tmpfiles
Date: Mon, 8 Apr 2019 22:03:25 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

On 8/4/2019 21:19, Robert Elz wrote:
> In general here docs (and here strings) are overused - it is always
> possible to simply write a pipe instead

What is nice about here docs/strings is that there are no subshells
involved.

I think Linda's main drive is to seek improvement in how bash works. Now
that lack of memory is in no way a constraint for the vast majority of
situations where bash is commonly used, it would be great if that memory
could be used instead of writing to a file system -- whether a pipe, a
here doc/string does that, or explicitly through redirection. Things
could work without requiring the presence of a file system.

> Some do, actually - in fact, I think all do, they start off with
> no memory allocated, and grab more as data is written.   But they
> all have a limit on how much they will buffer for one pipe, otherwise
> one stupid process could clog the system for everyone (having no
> available memory/swap is a much worse situation than a filesystem
> simply being full.)

If temporary files are not created in all cases of here docs/strings, it
would be great if the buffer size that bash allocates could be set.

Bash not writing temporary files for here strings & docs would be a
great feature to me.

Peter



reply via email to

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