replaced pgrep

pgrep isn't available on OSX prior to 10.8, replaced it with grep & awk