killing processes automatically

view full story

http://unix.stackexchange.com – I need to kill all processs in a certain shell excluding certain processes. Like sh which is my shell. And the comand. This is what currently in my shell right now. rcihp146 :/home/msingh2> ps PID TTY TIME COMMAND 8880 pts/258 0:00 ps 5908 pts/258 0:00 sh But if there are some extra processes I would like to kill all of them excluding the above two. I tried a one liner for this purpose and it didn't work: rcihp146 :/home/msingh2> ps | awk '{system("kill -9 $1")}' sh: kill: The number of parameters specified is not correct. sh: kill: The number of parameters specif (HowTos)