Who's in my Directory ?
Bruce Barnett
barnett at grymoire.crd.ge.com
Sat Dec 1 03:46:48 AEST 1990
In article <109418 at convex.convex.com> tchrist at convex.COM (Tom Christiansen) writes:
>In article <BARNETT.90Nov28121406 at grymoire.crd.ge.com>,
>barnett at crdgw1.ge.com scrawls:
(p.s. I apologize for the bad handwritting. You should see what it looks
like when I don't use a keyboard! :-)
>>This only works is a processes current working directory is visible
>>with a ps wweuax command.
>Sorry, but very few programs keep your cwd in the $PWD envariable. So
>this won't work very often. I would still go with fuser for SysV boxes,
>fstat for BSD ones, or ofiles if you can't find any better.
Yeah - I know. But I wanted to post something that sometimes works and
doesn't require any special program. No one else posted a shell only
"solution".
Unmounting a file system in an emergency is a tough problem if you use
talk(1), wall(1), and the telephone - and the guy doesn't answer.
I used the above script to detect and the force program to change
someone's current directory, if I could. (Force is a program by
jjg at linus.UUCP (Jeff Glass) that I got from comp.sources.misc. It uses
the TIOCSTI ioctl).
If not - the kill command is sure to get their attention. :-)
I looked at your script, and it doesn't quite work on my Sun4.
the SZ field can be 4 characters wide, and runs into the NI field:
F UID PID PPID CP PRI NI SZ RSS WCHAN STAT TT TIME COMMAND
80012067 6958 6957 32 33 02056 2680 R co 16:39 process
I am willing to work on a perlized version of the above, but Tom is a
zillion times better than I am with perl. (Tom - send me e-mail if you
want to continue this).
--
Bruce G. Barnett barnett at crd.ge.com uunet!crdgw1!barnett
More information about the Comp.unix.misc
mailing list