Considering a routine such as this one:
alpha() { echo a b c |tr ' ' '\n'; }
which outputs a stream, I would like to take the output stream, transform it, and
paste
it with the original output stream.
If I take use upcasing as a sample transformation, I can achieve what I want with:
$ mkfifo p1 p2
$ alpha | tee p1 >( tr a-z A-Z > p2) >/dev/null &
$ paste p1 p2
a A
b B
c C
My question is, is there a better way to do this, preferably one not involving named pipes?
Asked by Petr Skocik
(29590 rep)
Jul 25, 2015, 12:06 AM
Last activity: May 31, 2017, 10:32 PM
Last activity: May 31, 2017, 10:32 PM