View Issue Details

IDProjectCategoryView StatusLast Update
00002401003.1(2008)/Issue 7Shell and Utilitiespublic2013-04-16 13:06
Reporterajosey Assigned Toajosey  
PrioritynormalSeverityEditorialTypeClarification Requested
Status ClosedResolutionAccepted As Marked 
NameAndrew Josey
OrganizationThe Open Group
User ReferenceIEEE-interp-23-feb-2010-xcu-cd
Sectioncd
Page Number2506
Line Number80243-80245
Interp StatusApproved
Final Accepted TextSee 0000240:0000417
Summary0000240: cd $OLDPWD variable
Description(this is a forwarded Interpretation request from IEEE)

Standard says to set $OLDPWD to $PWD if "the PWD environment variable is
changed" or if “the PWD environment variable value is changed”?
Currently all the existing Posix shells don't compare OLDPWD and PWD
values, thus the result of cd command might be that OLDPWD is set to
current directory.
Desired ActionNone. Clarification is being requested
Tagstc1-2008

Activities

Don Cragun

2010-05-06 18:30

manager   bugnote:0000417

The standard clearly states that the OLDPWD environment variable must be set to the the current working directory immediately prior to the call to cd as long as the cd command completes successfully, and conforming implementations must conform to this.

Rationale:
-------------
When the standard requires that the PWD environment variable be set, that constitutes a change to the PWD environment variable even if the new value of PWD is the same as the old value of PWD.

Notes to the Editor (not part of this interpretation):
-------------------------------------------------------
To match other wording in the description of CD and remove the confusion noted by
the submitter,
change:
    PWD environment variable is changed
on P2506, L80243 to:
    PWD environment variable is set
and change:
    OLDPWD environment variable shall also be changed
on P2506, L80244 to:
    OLDPWD environment variable shall also be set


Also, change:
    None.
in the EXAMPLES section on P2508, L20323 to:
    The following template can be used to perform processing in the
    directory specified by "location" and end up in the current working
    directory in use before the first cd command was issued:

    cd location
    if [ $? -ne 0 ]
    then
            print error message
            exit 1
    fi
    ... do whatever is desired as long as the OLDPWD environment variable is not modified
    cd -

ajosey

2010-07-30 09:29

manager   bugnote:0000509

Comments/objections on the proposed interpretation are due by 31 Aug 2010

Issue History

Date Modified Username Field Change
2010-04-16 11:23 ajosey New Issue
2010-04-16 11:23 ajosey Status New => Under Review
2010-04-16 11:23 ajosey Assigned To => ajosey
2010-04-16 11:23 ajosey Name => Andrew Josey
2010-04-16 11:23 ajosey Organization => The Open Group
2010-04-16 11:23 ajosey User Reference => IEEE-interp-23-feb-2010-xcu-cd
2010-04-16 11:23 ajosey Section => cd
2010-04-16 11:23 ajosey Page Number => -
2010-04-16 11:23 ajosey Line Number => -
2010-04-16 11:23 ajosey Interp Status => ---
2010-04-22 16:26 Don Cragun Page Number - => 2506
2010-04-22 16:26 Don Cragun Line Number - => 80243-80245
2010-05-06 18:30 Don Cragun Note Added: 0000417
2010-05-06 18:34 Don Cragun Interp Status --- => Pending
2010-05-06 18:34 Don Cragun Final Accepted Text => See 0000240:0000417
2010-05-06 18:34 Don Cragun Status Under Review => Interpretation Required
2010-05-06 18:34 Don Cragun Resolution Open => Accepted As Marked
2010-07-30 09:29 ajosey Interp Status Pending => Proposed
2010-07-30 09:29 ajosey Note Added: 0000509
2010-09-03 06:21 ajosey Interp Status Proposed => Approved
2010-09-24 14:16 geoffclare Tag Attached: tc1-2008
2013-04-16 13:06 ajosey Status Interpretation Required => Closed