Unix/Linux Go Back    

Kill the running program

Shell Programming and Scripting

Kindly Note - This is a Single User Post by Forum Member akhtar.bhat Regarding:
Kill the running program.
Please Follow The Primary Link Above to View the Full Discussion.

Old Unix and Linux 12-26-2008   -   Original Discussion by akhtar.bhat
akhtar.bhat's Unix or Linux Image
akhtar.bhat akhtar.bhat is offline
Registered User
Join Date: Nov 2008
Last Activity: 2 November 2009, 2:28 AM EST
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Unix or Linux Question Kill the running program

Dear All,

I have a script which after executing is not stoping when i press ctrl+c.
Now i want to Append the script in such a way when i press ctrl+c while execution of the program it should take it as arguements and should kill the script/running program forcefully.

I know the command to kill the the program Forcefully (kill -9 `ps -a | grep "ping_script" | awk '{print $1}'` )

Please help me to get out of this problem.
Advance Thanks,
Akhtar Bhat.