And if all you really want is what you mentioned above, a list of pids and the number of file descriptors they have in use, try this:
Code:
#!/bin/bash
PIDS=`echo /proc/[0-9]* | sed 's/\/proc\///g' | sed 's/ /\n/g' | sort -n`
for i in $PIDS
do if [ -d "/proc/$i/" ]
then echo -n "$i: "
ls /proc/$i/fd/ | wc -w 2>/dev/null
fi
done
I just whipped this up on the fly, so there may be a bug or two, but I'm sure you get the idea.