From: Yohanes Santoso Date: 2002-01-06T01:54:29+09:00 Subject: [ruby-talk:30291] capturing both stdout and stderr of a subprocess Hi, I am trying to programatically interact with another program, much like expect. The problem is the interesting outputs are found both in stdout and stderr. Both `...`, and IO::popen() captures only stdout. Is there anyway to capture the stderr too? Or should I just IO::popen("/bin/ksh_or_your_fav_shell -c 'aProg 2>&1'") ? But if I redirect the stderr to stdout, I will never know the origin of each output. In my current case, it's not critical to know that this output comes from stderr, that output from stdout. However, may be in the future such thing is critical to know. Thanks, YS.