# Troubleshooting the 'system' call

**URL:** <https://www.ruby-forum.com/t/troubleshooting-the-system-call/91636>\
**Category:** Ruby\
**Created:** [April 11, 2007, 12:50am UTC](https://www.ruby-forum.com/t/troubleshooting-the-system-call/91636 "2007-04-11T00:50:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![barjunk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@barjunk](https://www.ruby-forum.com/u/barjunk)\
**Post date:** [April 11, 2007, 12:50am UTC](https://www.ruby-forum.com/t/troubleshooting-the-system-call/91636/1 "2007-04-11T00:50:29Z")

</div>

I was tyring to do a system call using sudo, like this:

system(“sudo /some/dir/somewhere/rubyprog.rb”,“opt1”, “opt2”)

but it kept giving me the wrong answer…always false. After some  
head knocking, I realized that this is more appropriate:

system(“sudo”,"/some/dir/somewhere/rubyprog.rb",“opt1”, “opt2”)

because the COMMAND is ‘sudo’ and the ruby program becomes the  
argument to sudo.

I realize that the docs say this fairly explicitly, but sheesh! 🙂

Mike B.
