From: Victor Reyes Date: 2007-12-27T11:53:06+09:00 Subject: Capturing error msgs from output = `cmd` ------=_Part_9814_716689.1198723992069 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello Team, I wrote the simple piece of code below which under "normal" circumstances it works fine. If, however, the command executed generates an error msg, the error is displayed on the screen. This is a behaviour which I don't want. I would like to capture ALL output generated by the command and return it to the caller. I tried different tricks but nothing worked. The question is: How can I capture ALL output from line: *userCMD_output = `#{input}`* including stderr??? require 'socket' port = 19557 server = TCPServer.new("", port) while (session = server.accept) input = session.gets userCMD_output = `#{input}` session.write("#{userCMD_output}") session.close end while you are at it, is there any way to obtain the caller's hostname or IP address? Thank you Victor ------=_Part_9814_716689.1198723992069--