Kill process

Hi

I want to kill the all process and want to use it inside my script
So it will take fields automatically and kill it...
for greping the field i use awk
___________________________
#!/user/local/bin/bash
..
..
#I get MULTIPULE lines , and my pid in 2nd field in this below code
myscript.sh | grep "my condition" | awk '{print $2}'

#Can I modify this line to kill this all pids
#I get this outpout in my script
1234
234
23456
2345
2345
#Also some contains duplicate pids

Use "killall" if you have it.

Not working

In what way is it "not working"?

Try piping the output into xargs kill

Thanks yazu and Corona :slight_smile:

Can you try something like below?

try

pkill -9 <name>