% cat ./tored tored () { local line while read line; do print "\e[31;1m$line\e[0m" done } % source ./tored % perl -e 'printf STDERR "this is stderr.\n"' this is stderr. % perl -e 'printf STDERR "this is stderr.\n"' | tored this is stderr. % perl -e 'printf STDERR "this is stderr.\n"' 2>&1 | tored this is stderr. % exec 2> >(tored) % perl -e 'printf STDERR "this is stderr.\n"' this is stderr.