Author: RevengerRevenger
Date: Jul 15, 2008 01:39
Hi!
I'm not working in AIX at all but I have the need to make a script that
would kill all the processes that have "ftp" in their name.
The system is AIX 5.2, shell - ksh.
I know how to list the processes and kill them manually:
# ps -ef | grep ftp
root 54758 6966 0 10:00:36 - 0:00 ftpd
root 60452 41750 0 10:15:25 pts/61 0:00 grep ftp
informix 67210 48028 0 02:53:10 - 0:01 ftp -n
informix 70494 21584 0 02:13:45 - 0:00 ftp -n
#
I need to kill all the processes that are running under the "informix"
account and have "ftp -n" in their name (not the ftpd daemon)
I tried it like this:
ps -ef | grep ftp | read uname pid c3 c4 c5 c6 srcstr
if "$uname" = "informix" && "$srcstr" = "ftp -n"
then
kill pid
fi
|