#!/bin/sh
ls /proc/*/exe 2>/dev/null | while read f; do
  link=`readlink $f`
  if echo "$link" | grep -q kde4; then
     pid=`echo $f | sed -e 's/[^0-9]//g'`
     echo "$link, pid $pid"
  fi
  if echo "$link" | grep -q valgrind; then
     echo "$link - WARNING, valgrind running"
  fi
done
