Interpretations

Answering questions that may arise related to the meaning of portions of an IEEE standard concerning specific applications.

IEEE Standards Interpretation for IEEE Std 1003.1™-2001 IEEE Standard Standard for Information Technology -- Portable Operating System Interface (POSIX®)

Copyright © 2006 by the Institute of Electrical and Electronics Engineers, Inc. 3 Park Avenue New York, New York 10016-5997 USA All Rights Reserved.

Interpretations are issued to explain and clarify the intent of a standard and do not constitute an alteration to the original standard. In addition, interpretations are not intended to supply consulting information. Permission is hereby granted to download and print one copy of this document. Individuals seeking permission to reproduce and/or distribute this document in its entirety or portions of this document must contact the IEEE Standards Department for the appropriate license. Use of the information contained in this document is at your own risk.

IEEE Standards Department Copyrights and Permissions 445 Hoes Lane, Piscataway, New Jersey 08855-1331, USA

Interpretation Request #93
Topic: pr, sh, + operand Relevant Sections: XCU pr, sh

The standard is unclear whether the utilities "pr" and "sh" must accept first operands that begin with "+". For example, must an implementation accept this command:

pr +file

as specifying an operand pathname "+file", or is the implementation allowed to reject "+file" as an invalid option, so that a portable application must use "pr -- +file" instead? Similarly, must an implementation accept this command:

sh ++

as specifying an operand command_file "++", or is it allowed to reject the "++" as an invalid option, so that a portable application must use "sh -- ++" instead?

Common practice is to reject such usages, which suggests that conforming applications should be cautious, and the standard should not be strict about what behaviors are required of implementations.

Please note that this problem description is limited to the first operand. A later Aardvark will take up the issue of operands after the first operand.

Add the following text to pr OPERANDS (after XCU page 739 line 28780):

The first operand, if any, shall not begin with "+" unless the operand is preceded by a "--" delimiter.

Add the following text to sh OPERANDS (after XCU page 852 line 33051):

The first operand, if any, shall not begin with "+" unless the operand is preceded by a "--" delimiter.

Interpretation Response
The standard is clear, the + character has no meaning as the first character of an operand for the pr utility , it is only allowed as the +page option case, so implementations are allowed to treat +x as an invalid page number or an operand. Portable applications should use pr -- +x to avoid this problem.

For sh, no change is needed. See the APPLICATION USAGE section.

Rationale for Interpretation
None.