From: jqwoods@... Date: 2008-03-15T03:44:57+09:00 Subject: How to separate stdout & stderr from executed shell command I would like to create a method which executes a given shell command and returns an array containing three things: 1) stdout of the command as a string, 2) stderr of the command as a string, and 3) the exit status. I'm having trouble figuring out how to get stdout and stderr as separate output. Here's an illustration of the desired result I'm after: irb> my_exec_command("ls existant_file") => ["existant_file\n", "", 0] irb> my_exec_command("ls NON_existant_file") => ["", "ls: NON_existant_file: No such file or directory\n", 2] Any pointers on how to implement my_exec_command?