Date: Tue, 31 Dec 1996 13:28:40 +0100 (MET) From: J Wunsch <j@uriah.heep.sax.de> To: rb@gid.co.uk (Bob Bishop) Cc: freebsd-bugs@FreeBSD.org (FreeBSD bugs list) Subject: Re: bin/2331: strange output of sh's pwd on symlinked directories Message-ID: <199612311228.NAA24801@uriah.heep.sax.de> In-Reply-To: <v01540b09aeeea4bd2715@[194.32.164.2]> from Bob Bishop at "Dec 31, 96 11:17:43 am"
next in thread | previous in thread | raw e-mail | index | archive | help
As Bob Bishop wrote: > > Our /bin/sh used to be one of the last remaining > >shells where the output of the builtin pwd was still similar to > >/bin/pwd (no surprise, since it did call /bin/pwd!). > > It's for reasons like this that no-one in their right mind uses anything > except /bin/sh to execute scripts (POSIX notwithstanding). Heaven knows how > many scripts in the world will break if this insanity is perpetuated. I > think that having pwd != /bin/pwd for /bin/sh is a *very bad idea*. You gotta live with it anyway: Posix doesn't know the concept of multiple shells. Our /bin/sh is aiming to become Posix-compliant, so your scripts should cope with this. You will never know what kind of shell your script actually hits. Remember, most Linux sites have bash as their /bin/sh. I agree that we should not _push_ divergency from traditional behaviour, but we can _tolerate_ it if it's still in the line of Posix. If scripts break by this, we have to change them. I'm not fully sure why sh's pwd is now different from /bin/pwd. If the only reason for this is that we're now using getcwd(3) instead of exec'ing pwd(1), i'm all for keeping it. The overhead of a fork/exec was terrible. Of course, the bug where `cd ..' didn't work correctly needs to be fixed, too. -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199612311228.NAA24801>