Simple, is a major feature of Ruby, start the new thread and get the standard output is also as simple:
Output = IO.POPEN ('DIR')
This gives an IO object, you can standard IO operations on this object.
P Output.Readlines
Or, write the output to the file
f = file.new ("Output.txt", "W")
Begin
Output.each_Line DO | LINE |
F.Write Line
end
Rescue SystemCallerror
P $!
Ensure
f.close
end