Recently I wanted to put the content of the stdout and the stderr of a command into variables (without needing to write to a file), something like this:

sterr=$(cmd >>>stout)

Or:

stout=$(cmd 2>>>sterr)

Or even:

cmd >>>stout 2>>>sterr

Obviously the idea is to introduce an operator >>> that functions as a "reverse here-document" that stores the content of a file stream into a variable. There would be less need to store things in a file on a filesystem.

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

Thanks for considering this,
Peter

Reply via email to