#!/bin/sh # # nr-of-httpd-processes - print the number of running /usr/sbin/httpd processes # # $Id$ ps -ef | perl -lne 'm# /usr/sbin/(httpd|apache2)\b# and ++$seen{$_}; END {print scalar keys %seen}'