Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14273

Re: Directing into a variable doesn't work

Path csiph.com!3.us.feeder.erje.net!feeder.erje.net!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail
From Robert Elz <kre@munnari.OZ.AU>
Newsgroups gnu.bash.bug
Subject Re: Directing into a variable doesn't work
Date Mon, 25 Jun 2018 00:27:30 +0700
Lines 22
Approved bug-bash@gnu.org
Message-ID <mailman.2503.1529861302.1292.bug-bash@gnu.org> (permalink)
References <f2371578-5dfe-93f5-b242-1fa5b9ffa7f9@passchier.net> <634e501a-5db1-d9ae-ae0b-bb3b414a2def@passchier.net> <acc5bff9-868a-31be-7439-c014fc517122@inlv.org>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
X-Trace usenet.stanford.edu 1529861302 23626 208.118.235.17 (24 Jun 2018 17:28:22 GMT)
X-Complaints-To action@cs.stanford.edu
Cc Martijn Dekker <martijn@inlv.org>, bug-bash@gnu.org
To Peter Passchier <peter@passchier.net>
Envelope-to bug-bash@gnu.org
In-Reply-To <f2371578-5dfe-93f5-b242-1fa5b9ffa7f9@passchier.net>
X-detected-operating-system by eggs.gnu.org: Genre and OS details not recognized.
X-Received-From 2001:3c8:9009:181::2
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.21
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <http://lists.gnu.org/archive/html/bug-bash/>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
Xref csiph.com gnu.bash.bug:14273

Show key headers only | View raw


    Date:        Sun, 24 Jun 2018 22:26:52 +0700
    From:        Peter Passchier <peter@passchier.net>
    Message-ID:  <f2371578-5dfe-93f5-b242-1fa5b9ffa7f9@passchier.net>

  | I am surprised by the general internal usage of temporary files for
  | here-documents & here-strings, because (generally speaking) memory is
  | quite abundant,

That's not the real issue - rather it is that a here doc is presented to the
command beng run as a file descrptior - that command will want to do a
read() to obtain the data.  Simply sitting in memory doesn't help, that
memory isn't available to the command that is being run - it needs to be
in a file, or sent through a pipe.   The file method is more general, as it
also allows mmap(), and is much easier to write the code to avoid issues
when there is more than one here doc for the same command - so the
data needs to be available to both in whatever order the command wants it.

Much the same arguments would apply to output.

kre

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: Directing into a variable doesn't work Robert Elz <kre@munnari.OZ.AU> - 2018-06-25 00:27 +0700

csiph-web