View Issue Details

IDProjectCategoryView StatusLast Update
00011761003.1(2016/18)/Issue7+TC2Shell and Utilitiespublic2024-06-11 09:09
Reportergeoffclare Assigned To 
PrioritynormalSeverityEditorialTypeError
Status ClosedResolutionAccepted 
NameGeoff Clare
OrganizationThe Open Group
User Reference
Sectionmailx
Page Number2944
Line Number97497
Interp Status---
Final Accepted Text
Summary0001176: mailx file operand description refers to a file option-argument
DescriptionThe mailx OPERANDS section contains this text in the description of
the file operand:

    The meaning of the file option-argument shall be affected
    by the contents of the folder internal variable

The use of "option-argument" here is an editorial error; it should
say "operand".
Desired ActionChange:

    the file option-argument

to:

    the file operand
Tagstc3-2008

Activities

shware_systems

2017-12-09 14:30

reporter   bugnote:0003892

I agree it looks like an operand, but since the file is only valid when -f option present, it's more the Synopsis is in error to me.

Suggest Change P2943, L97435 from:
mailx −f [−HiNn] [−F] [file]

to:
mailx −f [file] [−FHiNn]

to show it is the optional argument to -f, not has significance by itself.

steffen

2017-12-09 15:47

reporter   bugnote:0003893

The (i think even historical but had to look as necessary) behaviour is that the operand of -f is taken from the command line if all other options have been worked.
It is not an optional argument of -f.
Me and the MUA i maintain document it as

     -f Read in the contents of the user's secondary mailbox[119]
            MBOX[583] (or the specified file) for processing; when XXX is
            quit, it writes undeleted messages back to this file (but be aware
            of the hold[408] option). The optional file argument will undergo
            some special Filename transformations[26] (also see file[179]).
            Note that file is not an argument to the flag -f, but is instead
            taken from the command line after option processing has been com‐
            pleted. In order to use a file that starts with a hyphen-minus,
            prefix with a relative path, as in ‘./-hyphenbox.mbox’.

This is with manual links (mdocmx) and possibly too lengthy for the standard, i presume.
Have a nice weekend!

geoffclare

2017-12-11 09:43

manager   bugnote:0003894

Historically the syntax was -f [file] i.e. -f had an optional option-argument.
POSIX doesn't allow this, and so -f was changed to a "plain" option with [file] as an optional operand, so that "mailx -f" to open ~/mbox would still work.

See the mailx RATIONALE:
In order to conform to the Utility Syntax Guidelines, a solution was required to the optional file option-argument to -f. By making file an operand, the guidelines are satisfied and users remain portable. However, it does force implementations to support usage such as:
mailx -fin mymail.box

shware_systems

2017-12-11 13:35

reporter   bugnote:0003895

As POSIX does allow optional option-arguments, in XBD 12.1, line 7214, it looked to me the intent was distinguishing the separate synopsis case by separating it from the argument but still characterizing it as an option-argument, as one of the syntax exceptions line 7206 accounts for, and permits the usages "mailx -f", "mailx -inf", "mailx -fmail.box", "mailx -infmail.box" and "mailx -inf mail.box", but not "mailx -fin mail.box". This may be a breaking change, not simply editorial, in other words.

steffen

2017-12-11 15:06

reporter   bugnote:0003896

Re #0003894:
Thank you. Indeed! In full: non-optional for 2BSD Mail, optional only at the end of the command line (blindly taking next argument otherwise) for 3BSD and 7th and 8th Edition. Earlier Unix mail no such option.

geoffclare

2017-12-11 15:16

manager   bugnote:0003897

Re 0001176:0003895, XBD 12.1 line 7214 relates to a few rare exceptions to the syntax rules. See lines 7204-7207. The original POSIX.2-1992 developers decided not to make an exception to those rules in the case of mailx -f but instead to change file to be an operand.

Issue History

Date Modified Username Field Change
2017-12-08 15:39 geoffclare New Issue
2017-12-08 15:39 geoffclare Name => Geoff Clare
2017-12-08 15:39 geoffclare Organization => The Open Group
2017-12-08 15:39 geoffclare Section => mailx
2017-12-08 15:39 geoffclare Page Number => 2944
2017-12-08 15:39 geoffclare Line Number => 97497
2017-12-08 15:39 geoffclare Interp Status => ---
2017-12-09 14:30 shware_systems Note Added: 0003892
2017-12-09 15:47 steffen Note Added: 0003893
2017-12-11 09:43 geoffclare Note Added: 0003894
2017-12-11 13:35 shware_systems Note Added: 0003895
2017-12-11 15:06 steffen Note Added: 0003896
2017-12-11 15:16 geoffclare Note Added: 0003897
2019-02-14 16:59 Don Cragun Status New => Resolved
2019-02-14 16:59 Don Cragun Resolution Open => Accepted
2019-02-14 16:59 Don Cragun Tag Attached: tc3-2008
2019-11-08 10:51 geoffclare Status Resolved => Applied
2024-06-11 09:09 agadmin Status Applied => Closed