#!/bin/bash # proc_cnt.sh - Counts processes countaining string (or all processes if argument is empty) # # # Martin Spasov (mspasov@techno-link.com) # This script is distributed under GPL. PROCNAME=$1 NUM=`ps ax | grep "$PROCNAME"|wc -l` echo -n "$NUM" |awk '{ printf("%i", $1) }'