On Tue, Jun 19, 2007 at 10:17:17AM -0600, andrey mirtchovski wrote:
i just found a small program i had forgotten about that mimics unix' lsof. it's in /contrib/andrey/cmd/lsof.c
I don't really see the point. It seems only marginally easier, if at all, than grepping /proc/*/fd. Most of the time, I think you'd want to grap the output, anyway, in which case, it's easier to just grep /proc. But, assuming it's useful, why write it in C when you may as well write it in rc?
#!/bin/rc
if(~ $#* 0)
* = `{cd /proc; echo *}
grep '.?' /proc/^$*^/fd | sed 's,^/proc/([0-9]+)/fd:,\1 ,'
--
Kris Maglione
You can't fix it if it ain't broke.
pgpEwb3Axai6N.pgp
Description: PGP signature
