From: Kai.Grossjohann@CS.Uni-Dortmund.DE (K. ) - 2002-01-06 14:27:46
|
Given that `command' is a command which prints something to stdout and also something to stderr, does the following work to prefix all stdout lines with O and all stderr lines with E? { { command|sed 's/^/O: /' >&3;} 2>&1|sed 's/^/E: /';} 3>&1 In particular, I'm interested in AIX, IRIX, and other exotic systems. I used the following shell script to test: /---- | #!/bin/sh | echo stdout1 | echo stderr 1>&2 | echo stdout2 \---- tia, kai -- Simplification good! Oversimplification bad! (Larry Wall) |