Forum: Ruby troubleshooting the 'system' call

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
barjunk (Guest)
on 2007-04-11 02:50
(Received via mailing list)
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.
This topic is locked and can not be replied to.