From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 6 23:31:44 2007 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FB8316A418; Tue, 6 Nov 2007 23:31:44 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (meestal-mk5.stack.nl [IPv6:2001:610:1108:5010::149]) by mx1.freebsd.org (Postfix) with ESMTP id 45B7513C4A6; Tue, 6 Nov 2007 23:31:44 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id C9A8940E05; Wed, 7 Nov 2007 00:31:42 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id BC0312288B; Wed, 7 Nov 2007 00:31:42 +0100 (CET) Date: Wed, 7 Nov 2007 00:31:42 +0100 From: Jilles Tjoelker To: "Julian H. Stacey" Message-ID: <20071106233142.GA48427@stack.nl> References: <200711050002.lA502KUe064392@fire.js.berklix.net> <20071105085259.A39496@knop-beagle.kn.op.dlr.de> <200711061620.lA6GKE8L090019@fire.js.berklix.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200711061620.lA6GKE8L090019@fire.js.berklix.net> X-Operating-System: FreeBSD 6.2-STABLE i386 User-Agent: Mutt/1.5.16 (2007-06-09) Cc: hackers@freebsd.org, Harti Brandt Subject: Re: make: evaluation of symbolic link with ../ fails X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2007 23:31:44 -0000 On Tue, Nov 06, 2007 at 05:20:14PM +0100, Julian H. Stacey wrote: > It seems to me that all except csh (including bourne shell !) are > broken !! Amazing ! None of them cope properly actually following > symbolic links, they all make false premise the /some_path/.. == > /some_path ! This may be a little confusing, but is indeed the defined POSIX behaviour for pwd and cd. $PWD is used to store the "logical" path (potentially containing symlinks) that was cd'ed to. You can avoid the special behaviour with the -P (physical) option. cd -P will not treat symlinks specially and store a pathname not containing symlinks in $PWD; pwd -P will ignore $PWD and show a pathname not containing symlinks. A further thing to note is that csh does not have a pwd builtin (you are supposed to use dirs or prompt substitutions apparently) and that FreeBSD's /bin/pwd has the -P behaviour by default (you need -L to make it use $PWD). -- Jilles Tjoelker