Hi
I've been trying to close a program with the kill command automated. I looked at the man pages, but it only say to enter a process id like 11025 to kill.
I would like to grep httpd in ps and pipe that into kill.
Thanks
A third party security audit is the IT equivalent of a colonoscopy. It's long, intrusive, very uncomfortable, and when it's done, you'll have seen things you really didn't want to see, and you'll never forget that you've had one.
Go with streaker's suggestion and use killall. If you really wanted to us ps, grep, awk and so forth, you normally could, however, httpd is a slightly different animal. It forks multiple instances and just killing the root owned httpd process won't kill all the children. If you are set on using ps, you could try to pipe the output into grep for httpd and if the result is true, use /etc/rc.d/rc.httpd to stop the process cleanly. You'd have to chmod rc.httpd first.
Good luck...
Thanks you two, its what i was after.