How to capture stderr while using backtick?

Easiest way - don’t use backticks. Use Open3.

e.g.

require “open3”
in, out, err = Open3.popen3(“system command”)

Regards,

Dan

···

-----Original Message-----
From: Shashank Date [mailto:shanko_date@yahoo.com]

Ruby Gurus,

I am using backticks in my ruby script to run DOS
commands, but cannot figure out how to separate the
stdin from stderr.

Hi,

···

At Wed, 4 Sep 2002 21:50:55 +0900, Berger, Daniel djberge@qwest.com wrote:

I am using backticks in my ruby script to run DOS
commands, but cannot figure out how to separate the
stdin from stderr.

Easiest way - don’t use backticks. Use Open3.

e.g.

require “open3”
in, out, err = Open3.popen3(“system command”)

Note that Shashank uses mswin32 version, and open3 needs fork.

Open3 is one of pending list under Windows.


Nobu Nakada

Tried that but: fork in popen is not implemented on mswin.
Sorry!

“Berger, Daniel” djberge@qwest.com wrote in message
news:7DC1217518FCD311A08A0050DA78574003C6B5BB@iamspems04.interprise.com

···

-----Original Message-----
From: Shashank Date [mailto:shanko_date@yahoo.com]

Ruby Gurus,

I am using backticks in my ruby script to run DOS
commands, but cannot figure out how to separate the
stdin from stderr.

Easiest way - don’t use backticks. Use Open3.

e.g.

require “open3”
in, out, err = Open3.popen3(“system command”)

Regards,

Dan