# Getstatusoutput

**URL:** <https://www.ruby-forum.com/t/getstatusoutput/102547>\
**Category:** Ruby\
**Created:** [October 6, 2006, 3:07pm UTC](https://www.ruby-forum.com/t/getstatusoutput/102547 "2006-10-06T15:07:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![OliverMarchand](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/e19adc/32.png) [@OliverMarchand](https://www.ruby-forum.com/u/OliverMarchand)\
**Post date:** [October 6, 2006, 3:07pm UTC](https://www.ruby-forum.com/t/getstatusoutput/102547/1 "2006-10-06T15:07:48Z")

</div>

Dear Ruby fellows,

I am desperately trying to write a quite simple function (something  
similar to what I was acumstomed to with Python)

status, stdout, stderr = getstatusoutput(somecmdstring)

status is an integer, stdout and stderr are strings

Now in principle I know how to write such a function, but I don’t know  
what the best interface to spawn the process given in somecmdstring is.  
Here is my analysis of the situation:

IO::popen — mixes stdout and stderr  
Open3.popen3 — no possibility to wait for the process to finish  
exec — I would have to write “everything” by myself, double fork,  
etc.  
…popen4 — not a standard function

Is my analysis right, or is there something I am not understanding  
about open3?

thanks for any help,  
Oliver
