From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Tue, 19 Jun 2007 12:49:02 -0400 From: Kris Maglione To: 9fans@cse.psu.edu Subject: Re: [9fans] equivalent of fstat | grep $portnumber ? Message-ID: <20070619164902.GB67517@kris.home> References: <20070619152735.GB6960@pestilenz.org> <20070619161347.GA67517@kris.home> <14ec7b180706190917j3d1f2edbt68ef2c8d5df9f8cc@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TRYliJ5NKNqkz5bu" Content-Disposition: inline In-Reply-To: <14ec7b180706190917j3d1f2edbt68ef2c8d5df9f8cc@mail.gmail.com> User-Agent: Mutt/1.5.15 (2007-04-06) Topicbox-Message-UUID: 81768cb4-ead2-11e9-9d60-3106f5b1d025 --TRYliJ5NKNqkz5bu Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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=20 all, than grepping /proc/*/fd. Most of the time, I think you'd want to=20 grap the output, anyway, in which case, it's easier to just grep /proc.=20 But, assuming it's useful, why write it in C when you may as well write=20 it in rc? #!/bin/rc if(~ $#* 0) * =3D `{cd /proc; echo *} grep '.?' /proc/^$*^/fd | sed 's,^/proc/([0-9]+)/fd:,\1 ,' --=20 Kris Maglione You can't fix it if it ain't broke. --TRYliJ5NKNqkz5bu Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.3 (FreeBSD) iD8DBQFGeAj9seQZD8Aui4wRAg38AJoDtT970bPPnjpkYrh0/Erqn1+7qwCgl5zt 8UZpX/kPCYyytSIhVFLXVuU= =IgNW -----END PGP SIGNATURE----- --TRYliJ5NKNqkz5bu--