bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug in pwd POSIX-compliance


From: Chet Ramey
Subject: Re: bug in pwd POSIX-compliance
Date: Fri, 18 Feb 2005 12:04:52 -0500
User-agent: Mozilla Thunderbird 1.0 (Macintosh/20041206)

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    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]