#!/bin/bash for f in `pidof $*` do if [ -r /proc/${f}/root ]; then echo $f fi done