#!/bin/sh
# @(#)forall.sh	1.3 revision of 94/07/21  11:50:05
# This is an unpublished work copyright (c) 1989 HELIOS Software GmbH
# 30159 Hannover, West Germany

ESDIR=/usr/local/es

cmd=$1
shift
$ESDIR/etc/procstat|grep $cmd| (
nservers=0
while read x
do
	nservers=`expr $nservers + 1`
	pid=`echo $x|sed -e 's/\([^ ]*\).*/\1/'`
	$* $pid
done
exit $nservers )
