View Issue Details

IDProjectCategoryView StatusLast Update
00004591003.1(2008)/Issue 7Shell and Utilitiespublic2013-04-16 13:06
Reportercalestyo Assigned Toajosey  
PrioritynormalSeverityEditorialTypeClarification Requested
Status ClosedResolutionAccepted As Marked 
NameChristoph Anton Mitterer
Organization
User Reference
Sectionshift
Page Number2364
Line Number74748-74750
Interp StatusApproved
Final Accepted Text0000459:0000858
Summary0000459: clarification on the value of n for the shift built-in command
DescriptionHi.

With respect to http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=627856 ... could you please clarify, whether it is "allowed" to specify values n > $# to the shift special built-in or not or whether the results are undefined.

I'd say that it is allowed and exit status > 0 should be returned.


Cheers,
Chris.
Desired ActionClarification
Tagstc1-2008

Activities

geoffclare

2011-06-16 15:28

manager   bugnote:0000858

Interpretation response
------------------------
The standard is unclear on this issue, and no conformance distinction can be made between alternative implementations based on this. This is being referred to the sponsor.

Rationale:
-------------
None.

Notes to the Editor (not part of this interpretation):
-------------------------------------------------------

In the EXIT STATUS section change:

    The exit status is >0 if n>$#; otherwise, it is zero.

to:

    If the n operand is invalid or is greater than $#, this may be
    considered a syntax error and a non-interactive shell may exit; if
    the shell does not exit in this case, a non-zero exit status shall
    be returned. Otherwise, zero shall be returned.

calestyo

2011-06-30 22:29

reporter   bugnote:0000879

Uhm why not just clarfying this in the next version of the standard?

Don Cragun

2011-06-30 23:27

manager   bugnote:0000880

There is no reason to wait for the next revision of the standard to make this change.
The change will not break any existing implementation and clarifies that invoking
shift x (where x is an integral value larger than $#) is an error that may, but need
not, be considered a syntax error. In this case it is unspecified whether or not a
non-interactive shell will quit when this error is detected.

ajosey

2011-08-10 15:23

manager   bugnote:0000930

Interpretation proposed 10 August 2011 for final 30 day review

ajosey

2011-09-12 15:22

manager   bugnote:0000962

Interpretation approved 12 Sept 2011

Issue History

Date Modified Username Field Change
2011-06-05 15:26 calestyo New Issue
2011-06-05 15:26 calestyo Status New => Under Review
2011-06-05 15:26 calestyo Assigned To => ajosey
2011-06-05 15:26 calestyo Name => Christoph Anton Mitterer
2011-06-05 15:26 calestyo Section => ?
2011-06-05 15:26 calestyo Page Number => ?
2011-06-05 15:26 calestyo Line Number => ?
2011-06-15 15:37 Don Cragun Section ? => shift
2011-06-15 15:37 Don Cragun Page Number ? => 2364
2011-06-15 15:37 Don Cragun Line Number ? => 74748-74750
2011-06-15 15:37 Don Cragun Interp Status => ---
2011-06-16 15:28 geoffclare Interp Status --- => Pending
2011-06-16 15:28 geoffclare Note Added: 0000858
2011-06-16 15:28 geoffclare Status Under Review => Interpretation Required
2011-06-16 15:28 geoffclare Resolution Open => Accepted As Marked
2011-06-16 15:30 geoffclare Final Accepted Text => 0000459:0000858
2011-06-16 15:31 geoffclare Tag Attached: tc1-2008
2011-06-30 22:29 calestyo Note Added: 0000879
2011-06-30 23:27 Don Cragun Note Added: 0000880
2011-08-10 15:23 ajosey Interp Status Pending => Proposed
2011-08-10 15:23 ajosey Note Added: 0000930
2011-09-12 15:22 ajosey Interp Status Proposed => Approved
2011-09-12 15:22 ajosey Note Added: 0000962
2013-04-16 13:06 ajosey Status Interpretation Required => Closed