bensheares1
IS-IT--Management
Hi All,
Here's a script to kill all Clients with processes named "Client"
However, sometimes it worked and sometime it doesnt.
And I do not know what's wrong.
This is written by someone in Korn shell. Does this able to work using other shells, eg. csh and sh?
If not, how to make it work in csh or sh? What changes do I have to make?
>kill_client
no response
%kill_client
no response
========================================================
Filename:kill_client
#/usr/bin/ksh
ps | /usr/bin/grep Client | /usr/bin/grep -v grep | awk ' { KILL_CMD = sprintf("kill -9 %d",$1); system(KILL_CMD); print("KILL CLIENT " $1); } END { } '
========================================================
Anyone know whats wrong with it please let me know.
Thanks.
Best Regards,
Bensheares
Here's a script to kill all Clients with processes named "Client"
However, sometimes it worked and sometime it doesnt.
And I do not know what's wrong.
This is written by someone in Korn shell. Does this able to work using other shells, eg. csh and sh?
If not, how to make it work in csh or sh? What changes do I have to make?
>kill_client
no response
%kill_client
no response
========================================================
Filename:kill_client
#/usr/bin/ksh
ps | /usr/bin/grep Client | /usr/bin/grep -v grep | awk ' { KILL_CMD = sprintf("kill -9 %d",$1); system(KILL_CMD); print("KILL CLIENT " $1); } END { } '
========================================================
Anyone know whats wrong with it please let me know.
Thanks.
Best Regards,
Bensheares