randy@halcdc.UUCP (randy orrison) (11/15/88)
Is there an easy way to reverse the user to home directory mapping of /etc/passwd? That is, given an absolute pathname, tell me whose home directory it's in? In a simple, pre-nfs and symbolic links, filesystem, this isn't too bad, but in the worst case it can get complicated. e.g. my home directory is /u/randy /u/randy -> /n/halcdc/usr1/randy /n/halcdc is an nfs mount of halcdc:/usr1/randy I want a function that (run on halcdc) given '/usr/randy/junk/file' will tell me that it's in randy's home directory. Any ideas on how to do this? Thanks in advance! -randy