![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to Kill a Process | bennichan | SUN Solaris | 5 | 03-23-2008 10:14 PM |
| kill process | ust | UNIX for Advanced & Expert Users | 1 | 11-27-2007 09:06 AM |
| kill(0,-9) don't kill the process | umen | High Level Programming | 9 | 06-19-2007 03:09 AM |
| how to start a process and make it sleep for 5 mins and then kill that process | shrao | Shell Programming and Scripting | 6 | 03-27-2007 09:54 AM |
| When kill doesnt work, how to kill a process ? | VijayHegde | UNIX for Advanced & Expert Users | 3 | 05-12-2006 01:24 PM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
kill process help
i wanted to kill a process by entering the process name. How am i able to kill the process that allows user to enter the process name and kills it?
|
| Forum Sponsor | ||
|
|
|
|||
|
i wanted to kill the process from entering the program name instead of the pid, how can i do so?
eg. when i do a "ps -f U username" it will print out all pid,ppid,C,stime,tty,stat,time,cmd. but i would like to kill the process by entering name of the program from the cmd column. i use Code:
grep programName | awk '{print $9}' | xargs kill
Really hope there is someone to help me!!! |
|
|||
|
thanks Lakris!! it works!!! thanks!!!
but if i wanted to grep the input from user and kill the process how should i do it? i try but couldnt work!!! Code:
echo "enter program name"
read input
ps -ef U username|grep $input | awk '{print $2}' | xargs killall
|
|
|||
|
No problem, glad to help.
Not sure what isn't working for You, but maybe this will ( if You have $USER set) Code:
echo "enter program name"
read input
ps -ef U $USER|grep $input | awk '{print $2}' | xargs kill
/Lakris |
|||
| Google UNIX.COM |