IEEE Standards Interpretations for IEEE Std 1003.2™-1992 IEEE Standard for Information Technology--Portable Operating System Interfaces (POSIX®)--Part 2: Shell and Utilities
Copyright © 1996 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 #122
Topic: mailx command argument expansion for filenames Relevant Clauses: 184.108.40.206
In subclause 220.127.116.11 (P348, L6566-6570), it says: File names, where expected, shall be subjected to the process of shell word expansions (see 3.6); if more than a single pathname results and the command is expecting one file, the effects are unspecified. If the file name begins with an unquoted plus sign, it shall not be expanded, but treated as the named file (less the leading plus) in the folder directory. (See the folder variable.) While this language is clear, the actual historical behavior of this command should be expressed as follows (change bars are supplied on the left): File names, where expected, shall be subjected to the following transformations, in sequence: If the file name begins with an unquoted plus sign, and the folder variable is defined (see the folder variable), the plus sign shall be replaced by the value of the folder variable followed by a slash; if the folder variable is unset or is set to null, the filename shall be unchanged. Shell word expansions shall be applied to the file name (see 3.6); if more than a single pathname results from this expansion and the command is expecting one file, the effects are unspecified. I believe that this variance from actual historic practice was not intended. The rationale for mailx seems to carefully point out the cases where the standard differs from historic practice, but does not mention this issue.
The standard states the behavior for file name expansion in mailx and conforming implementations must conform to this. However, concerns have been raised about this which are being referred to the sponsor.
Rationale for Interpretation