Eric Blake wrote:

On further research, the requirement for `pwd -P' to set PWD was intentional, and not a mistake. See POSIX XRAT A.3 (http://www.opengroup.org/onlinepubs/009695399/xrat/xbd_chap03.html) under Symbolic Links line 1148, which states:

Historically, several shells have had built-in versions of the pwd utility. In some of these shells, pwd reported the physical path, and in others, the logical path. Implementations of the shell corresponding to IEEE Std 1003.1-
2001 must report the logical path by default. Earlier versions of IEEE Std 1003.1-2001 did not require the pwd utility to be a built-in utility. Now that pwd is required to set an environment variable in the current shell execution environment, it must be a built-in utility.


Also, see the followup mails to my defect report, as posted on the Austin mailing lists: http://www.opengroup.org/austin/mailarchives/ag/msg08028.html. Just because no non-compliant shell does it that way is not an excuse for bash to not do it, at least when bash is installed as the compliant sh.

I understand that, but no shell does it. Period. Even those claiming compliance, like bash and ksh93. It's an artificial requirement. Certainly it's non-intuitive for a builtin that's not performing any modifying action to change $PWD as part of its execution.

Don Cragun's reply didn't include any rationale for pwd's behavior. I
suspect there is none.  Even the stated desire for consistency is
not compelling.

If I change bash's behavior in this case, it will be only in posix mode.

Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
                                                Live...Laugh...Love
Chet Ramey, ITS, CWRU    [EMAIL PROTECTED]    http://cnswww.cns.cwru.edu/~chet/


_______________________________________________ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listinfo/bug-bash

Reply via email to