On Thu, Oct 13, 2011 at 8:22 AM, Marc Heiler <shevegen / linuxmail.org> wrote: > Hi. > > Let's say I have a GNU autoconfigure based program like htop: > > ¨Âôô𺯯äæî®äì®óïõòãåæïòçå®îåô¯óïõòãåæïòçå¯èôïð¯èôïð°®¹®ôáò®ç> > Ok, I downloaded it and extract it. Then I change to the > extracted archive and run: > > ¨Âåóõìயãïîæéçõòå> > Question 1: > > I don't seem to get the output of this command, when it is done > like the above way. What exactly do you mean by that? Do you expect the output in result or on the terminal? > Normally via autoconfigure, I get line after line output. > > I would like to have the same functionality from within ruby, > but capture the whole result into the string. > > Question 2: > > I want to check for errors but I am not sure how to best > do this. > > For instance, an error could be like this here: > > ¨Âðáãëáç§çô뫳®°§ æïõî> > I could grep the whole string for something like that. > > But perhaps there is another way? An error result that is > set and which I could use in Ruby? > > Any pointers appreciated! I suggest to look at popen and variants which give you more control about the child process http://rdoc.info/stdlib/core/1.9.2/IO#popen-class_method http://rdoc.info/stdlib/open3/1.9.2/Open3#popen3-instance_method Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/