#!/bin/rc rfork e for (i in /proc/[0-9]*) { eval `{ awk '{printf "cmd=''''%s''''\nuser=%s\n", $1, $2; exit}' < $i/status } awk ' BEGIN { p = ENVIRON["i"] sub(".*/", "", p) } NR == 1 { next } { printf "%-10s %12s %8d %s\n", ENVIRON["user"], ENVIRON["cmd"], p, $0 } ' < $i/fd }