[H-GEN] stderr redirection

Stephen Thorne stephen at thorne.id.au
Thu May 28 23:14:20 EDT 2009


On 2009-05-29, Clinton Roy wrote:
> which works fine for the error filter, but it means that bitten does
> not get to see stderr, thus when a build fails the reason for it is
> hidden.

Right, so this is one solution, using tee, and some trickery:

This is my testing shell command will print foo on stdout and bar on
stderr:
(printf "foo\n"; printf "bar\n" >&2) 

Using tee to get stdout in a file:
(printf "foo\n"; printf "bar\n" >&2) | tee stdout.txt

Using tee to get stderr in a file: 
(printf "foo\n"; printf "bar\n" >&2) 3>&1 1>&2 2>&3 | tee stderr.txt

-- 
Regards,
Stephen Thorne
Development Engineer
NetBox Blue - 1300 737 060



More information about the General mailing list