[WBEL-users] Another Shell Scripting Question

Randy Kelsoe randykel at swbell.net
Fri Jun 17 07:14:57 CDT 2005


Andrew Vong wrote:

>
> Dear Gurus,
>
> A BIG thank you to all for your contributions. I have learnt from ALL 
> your examples.
>
> Here is what I have ended up with:-
>
> ps x | grep "[s]sh -f -N" | awk '{ print $1 }' | xargs kill -p
>
> I suppose this would work great if there were only 1 process as a 
> result of the cmd above.
>
> What would happen if there were more than 1 PID from std output?
>
> Will it kill ALL PIDs that were produced from std output?
>
> Thanks again. :)
>
> Best Regards,
> Andrew


Since no one mentioned the 'pidof' command, you might want to check it 
out (man pidof).




More information about the Whitebox-users mailing list