Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!mcvax!ukc!reading!riddle!andrew From: andrew@riddle.UUCP (Andrew Beattie) Newsgroups: comp.unix.questions Subject: Re: ksh and sh Message-ID: <1036@riddle.UUCP> Date: 12 Jul 89 10:06:16 GMT References: <372@trevan.UUCP> <1154@crdgw1.crd.ge.com> Reply-To: andrew@riddle.UUCP (Andrew Beattie) Organization: Sphinx Ltd., Maidenhead, England Lines: 33 In article <1154@crdgw1.crd.ge.com> davidsen@crdos1.UUCP (bill davidsen) writes: >In article <372@trevan.UUCP> trevor@trevan.UUCP (trevor) writes: >| >| Using Microport System V/AT and the korn shell for logins >| I have found if I execute /bin/sh and then execute pwd I get an >| error message pwd: cannot read .. . I suspect it is something to do with > ^^^^^^^^^^^^^^^^^^^ > What are the permissions on the parent directory? May very well >be a legitimate problem (although a new one to me). There again, it may not be a legitimate problem. I have come across systems where pwd gets tripped up at the mount point, eg: You are in the directory /usr/john, where /usr is a mounted file system. Before the /usr file system is mounted, the /usr directory on the root file system has 700 permissions. The root directory of the /usr file system has 755 permissions, which is what is seen when the /usr filesystem is mounted on the /usr directory. This all looks correct. The problem is that pwd seems to be able to pick up the permissions of the /usr directory which should be hidden. BTW, pwd normaly finds out where you are by knowing where you started and keeping track of every cd. The first time you call pwd however, it must climb up the directory tree to find your location. When trying to work round this problem, bear in mind that if you cd before you pwd then pwd will not have to climb the tree and that you may have a PWD environment variable, so exporting you PWD variable in your login shell and puting cd `$PWD` into your .kshrc (run for every ksh you start) may will be a win. Andrew