[OT] combine stdout and stderr...

Jorge Almeida jjalmeida at gmail.com
Tue Mar 3 07:31:55 PST 2009


...in C?

 	#!/bin/bash
 	exec 2>&1
 	exec someprogram

This executes someprogram with stdout and stderr combined, meaning that
what is written to fd 2 really goes to fd 1. The shell is spawned just
to do this merging, and then it is dropped. There must be a way to do it
in the code of someprogram, but it doesn't seem easy to google for it...
...Some pointers, anyone?

-- 
Jorge Almeida



More information about the Linux-users mailing list