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


Groups > gnu.bash.bug > #14270

Directing into a variable doesn't work

From Peter Passchier <peter@passchier.net>
Newsgroups gnu.bash.bug
Subject Directing into a variable doesn't work
Date 2018-06-24 10:08 +0700
Message-ID <mailman.2481.1529821932.1292.bug-bash@gnu.org> (permalink)

Show all headers | View raw


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

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


Thread

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

csiph-web