LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   terminating this (https://www.linuxquestions.org/questions/linux-software-2/terminating-this-523165/)

munna_dude 01-26-2007 11:52 PM

terminating this
 
hi all

how can i kill this application by programatically

am trying like this

int main()
{
system("sudo ruby /root/Desktop/ruby/example.rb");
printf("before sleep");
sleep(5);
system("exit");
printf("after sleep");
}

it is not terminating.

i think control will be at system("sudo ruby /root/Desktop/ruby/example.rb");
here.

is there any ruby code to terminate this in programatically

can show me the way please.

thank you

wjevans_7d1@yahoo.co 01-27-2007 04:22 AM

I'm not sure exactly what you're asking, but system("exit") does not do what you think it does. All it does is exit from that system() call.

What you want to do instead of the system("exit") is this:

exit(0);

Hope this helps.


All times are GMT -5. The time now is 08:04 PM.