[How do I:] get what's in $stderr as a string?

M

Mark Wilson

How do I get access to what's in $stderr in the form of a string?

In particular, I am using the following code

require 'shell'
Shell.def_system_command("dialog")
shell = Shell.new
shell.transact do
shell.dialog("--title", "test", "--menu", "test", "0", "0", "9", "test
tag", "test item")
end

dialog directs output, in this case, "test tag" to STDERR after the
user presses enter.

I would like to capture the value "test tag" as string assigned to a
variable.

Does anyone know a way to do this? Hopefully a simple way.

I'm aware of a way to do something similar provided by Brain Candler in
an earlier message:

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/71151

I am having trouble following how I might implement the above, and I
don't know if it is the answer to the difficulty I am having.

Thank you in advance for any help.

Regards,

Mark Wilson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top