#!/bin/sh
if test -z "$1" ;then
  echo Usage: mypidof process-name
  exit 1
fi
tmp=/tmp/ps-$$
ps > $tmp
cat $tmp | tail -n +3 | grep "$1" | grep -v mypidof | sed -e 's/^  *//g;s/ .*//g'
rm $tmp
