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


Groups > gnu.bash.bug > #14273 > unrolled thread

Re: Directing into a variable doesn't work

Started byRobert Elz <kre@munnari.OZ.AU>
First post2018-06-25 00:27 +0700
Last post2018-06-25 00:27 +0700
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#14273 — Re: Directing into a variable doesn't work

FromRobert Elz <kre@munnari.OZ.AU>
Date2018-06-25 00:27 +0700
SubjectRe: Directing into a variable doesn't work
Message-ID<mailman.2503.1529861302.1292.bug-bash@gnu.org>
    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

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web