troubleshooting the 'system' call

B

barjunk

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top