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.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 #103
Topic: mailx escaped commands when stdin is not a terminal Relevant Clauses: 4.40.7

I would like to request a formal interpretation on the following issue concerning the mailx utility in POSIX.2. In subclause 4.40.7, the Extended Description of the mailx command, (P342, L6312-6321), it says: ... When mailx is invoked using the Send Mode synopsis, and standard input is a terminal, if no subject is specified on the command line and the asksub variable is set, a prompt for the subject shall be written.

At this point mailx is in input mode. This input mode is also entered when using one of the Receive Mode synopsis forms and a reply or new message is composed using reply, Reply, or mail commands. When the message is typed and the end of the message is encountered, the message shall be passed to the mail delivery software. Commands can be entered by beginning a line with the escape character [by default, tilde (~)] followed by a single command letter and optional arguments.... Does the definition of "input mode", then, necessarily require that stdin is a terminal? This seems unclear when Receive Mode is involved. That is to say, does echo "reply 1\naaaa\n~w repl" | mailx -n -f mbox produce a mail message sent to the all recipients of the first message in mbox which contains the message aaaa ~w repl or does it mail a message containing aaaa and create a copy of this message in the file repl?

To match historic practice of the System V mailx, on which the standard is based, the sentence on P342, L6315-6317, should be changed to: This input mode is also entered when using one of the Receive Mode synopsis forms and a reply or new message is composed using the reply, Reply, or mail commands, and stdin is a terminal. Also, a sentence needs to be added after the end of the paragraph ending on (P342, L6321) which states: It is unspecified what effect these commands will have if stdin is not a terminal when a message is entered using either the Send Mode synopsis, or the Read Mode commands reply, Reply or mail. I believe that this change to 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.

Interpretation Response #102
The standard clearly states the behavior of "input mode" and stdin, and conforming implementations must conform to this. However, concerns have been raised about this which are being referred to the sponsor.

Rationale for Interpretation