how to find a users *true* home directory with a shell script? 

Newsgroups: comp.unix.shell,comp.unix.admin
>>Here's my suggestion:
>>
>>UsersHomedir=`cd ~$UserID;pwd`
>>
>
>Unfortunately, depending on your implementation of pwd, this may
>return the symlinked path.  (It certainly does for me on Linux, HP-UX,
>AIX, IRIX, and Solaris).

Investigating further - this works fine if the pwd concerned is /bin/pwd and not /sbin/pwd.

Julian

how to find a users *true* home directory with a shell script? 

$ dir /home
lrwxrwxrwx    1 root     root           12 Dec 16 01:09 /home -> /export/home/
tong@sunny:~$ pwd
/home/tong
tong@sunny:~$ type pwd
pwd is a shell builtin
tong@sunny:~$ sh -c pwd
/home/tong
tong@sunny:~$ /bin/pwd
/export/home/tong
tong@sunny:~$ /sbin/pwd
bash: /sbin/pwd: No such file or directory

documented on: 2001.05.16 Wed 17:25:51