Right now I have this:
echo "$run_test" | bash 2>&1 | prepend "r2g-test:" "yellow"; What this does is prepend "r2g-test:" to each line of the stdout/stderr. Because I am sending stderr to stdout, the prepend program doesn't know the difference because it's all stdin to it.
Is there some way I can send stderr to a different prepend instance, perhaps with tee?
Perhaps something like this?
echo "$run_test" | bash 2> $(prepend 'r2g-test:' 'red') | prepend 'r2g-test:' 'yellow'; This might work, with process substitution:
bash 2> >(prepend 'r2g-test:' 'red') But so far, the stderr never shows up in the terminal