From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: To: 9fans@cse.psu.edu Subject: Re: [9fans] killing rogue processes From: mirtchov@cpsc.ucalgary.ca In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Fri, 19 Dec 2003 10:25:48 -0700 Topicbox-Message-UUID: acc3e674-eacc-11e9-9e20-41e7f4b1d025 > #!/bin/rc >> > cd /proc >> > for (i in *) >> > cat $i/fd | sed s/^/$i' '/ This one actually works: % cat lsof #!/bin/rc cd /proc for (i in *) if(! ~ $i trace) cat $i/fd | sed 's/^/'^$i^' /' % Subst that for lsof.c if you wish -- simple is better :) By the way, it wasn't a script because I was doing 'ls /proc' instead of 'in *' and had to deal with the 'ls' process exiting before I had gotten around to catting its fd file, not that I didn't try :) andrey