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


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

Directing into a variable doesn't work

Started byPeter Passchier <peter@passchier.net>
First post2018-06-24 10:08 +0700
Last post2018-06-24 10:08 +0700
Articles 1 — 1 participant

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


Contents

  Directing into a variable doesn't work Peter Passchier <peter@passchier.net> - 2018-06-24 10:08 +0700

#14270 — Directing into a variable doesn't work

FromPeter Passchier <peter@passchier.net>
Date2018-06-24 10:08 +0700
SubjectDirecting into a variable doesn't work
Message-ID<mailman.2481.1529821932.1292.bug-bash@gnu.org>
With memory being abundant and filesystem access expensive, I want to
put stdout and stderr of a command into variables (without needing to
write to a file):

output=$($command 2>>>errors)

Or:

$command >>>output 2>>>errors

Obviously this gives a syntax error now, as this intuitive idea isn't
implemented (yet). Any chance for a fix, to introduce an operator >>>
that functions as a "reverse here-document" that stores the content of a
file stream into a variable?

I think that would be very useful extension, easy to comprehend in the
light of current syntax, and not clashing with anything existing as far
as I can see.

Peter

[toc] | [standalone]


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


csiph-web