home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / unix / admin / 6737 < prev    next >
Encoding:
Internet Message Format  |  1992-12-21  |  1.4 KB

  1. Xref: sparky comp.unix.admin:6737 comp.unix.questions:14855
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!swrinde!gatech!prism!gs26
  3. From: gs26@prism.gatech.EDU (Glenn R. Stone)
  4. Newsgroups: comp.unix.admin,comp.unix.questions
  5. Subject: Re: showing working dirs of each users
  6. Message-ID: <78677@hydra.gatech.EDU>
  7. Date: 21 Dec 92 16:44:13 GMT
  8. References: <1992Dec21.082746.23803@latcs1.lat.oz.au>
  9. Reply-To: glenns@eas.gatech.edu
  10. Followup-To: comp.unix.admin
  11. Organization: The Group W Bench
  12. Lines: 20
  13.  
  14. In <1992Dec21.082746.23803@latcs1.lat.oz.au> wongm@latcs1.lat.oz.au (M.C. Wong) writes:
  15. >  I wonder if there is any utility that shows which working dir each
  16. >  of the users are in, much like the finger and w command but also shows
  17. >  where they are. Thank you !!
  18.  
  19. Not that I know of; I do know that it would be a royal pain to do (probably
  20. involving C and setuid executables) on a SysV box... but if you luck out
  21. and have BSD or some variant thereof, you can probably cobble something
  22. together in a shell script, starting like 
  23.  
  24. ps agxeww | egrep -e [ -][t-][ck]sh | awk {some really funky stuff here}
  25.  
  26. Where the above assumes nobody's running /bin/sh for a login shell, 
  27. and {some really funky stuff} extracts the PWD= field from the output
  28. of ps....
  29.  
  30. food for thought....
  31.  
  32. Glenn R. Stone (glenns@eas.gatech.edu)
  33. Do not meddle in the affairs of wixards, it makes them soggy and hard to light.
  34.