LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-26-2007, 11:52 PM   #1
munna_dude
Member
 
Registered: Dec 2006
Posts: 362

Rep: Reputation: 30
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
 
Old 01-27-2007, 04:22 AM   #2
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 31
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
terminating a file kryptonite0110 Programming 4 04-03-2006 12:07 PM
pppd keeps terminating connection gkiagia Linux - Networking 9 06-15-2005 12:07 PM
Terminating one thread from another orinjus Programming 2 05-20-2004 07:25 PM
programs terminating santasballz Linux - Newbie 3 03-10-2004 09:47 AM
terminating wvdial Freestone Linux - Newbie 6 02-22-2003 12:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration