View Issue Details

IDProjectCategoryView StatusLast Update
00016401003.1(2016/18)/Issue7+TC2Shell and Utilitiespublic2024-06-11 09:07
Reporterkre Assigned To 
PrioritynormalSeverityObjectionTypeError
Status ClosedResolutionAccepted As Marked 
NameRobert Elz
Organization
User Reference
SectionXCU 3 / true
Page Number3318
Line Number111745 - 111748
Interp Status---
Final Accepted Text0001640:0006206
Summary0001640: The rationale given for retaining "true" is nonsense.
DescriptionThe RATIONALE section of the page for the "true" utility says:

    The true utility has been retained in this volume of POSIX.1-2017,
    even though the shell special built-in : provides similar functionality,
    because true is widely used in historical scripts and is less cryptic to
    novice script readers.

That text remains unchanged in Issue 8 draft 2.1

The functionality is only vaguely similar, true is a normal utility, ':' is
a special builtin, hence the consequences of redirection errors are
different, and use, redirections are used with these utilities.

Further, the OPERANDS listed for "true" are "None" which XCU 1.4 says
means "When this section is listed as ``None.'', it means that the
implementation need not support any operands.", which allows an
implementation to do things with operands if it wants, including issueing
an error message failing (turning info "false"). While none do, that I
am aware of (true is generally, and entirely, "exit 0" or "exit(0)" in C)
it is possible.

Finally, since this bug is being submitted against Issue 7 TC2,
XCU 2.9.1.1 bullet point 'd' says:

     If the command name matches the name of the type or ulimit utility,
     or of a utility listed in the following table, that utility shall be
     invoked.

Note "shall be invoked" and "true" is in the table. If there were no
"true" utility, that would be impossible, so deleting true really could
not have happened (back then) no matter how redundant it seemed to be.

Note that in Issue 8 draft 2.1, this has altered, it is now 2.9.1.4
(still bullet point d) but that now refers to the intrinsic utilities
defined in XCU 1.7, and "true" is not in that list.
Desired ActionDelete the entire RATIONAL section (lines 111746 - 111748) and replace
them with
None.

Tagsapplied_after_i8d3, tc3-2008

Activities

stephane

2023-03-12 16:54

reporter   bugnote:0006202

GNU true accepts some --version, --help options.

I don't have access to ksh93 just now but I'd expect its true to supports those as well as --author --man --usage and many more in that vein like most of its builtins do.

geoffclare

2023-03-16 15:54

manager   bugnote:0006206

On page 3317 line 111737 section true (APPLICATION USAGE), change:
The special built-in utility : is sometimes more efficient than true.
to:
Although the special built-in utility : (colon) is similar to true, there are some notable differences, including:

  • Whereas colon is required to accept, and do nothing with, any number of arguments, true is only required to accept, and discard, a first argument of "--". Passing any other argument(s) to true may cause its behavior to differ from that described in this standard.

  • A non-interactive shell exits when a redirection error occurs with colon (unless executed via command), whereas with true it does not.

  • Variable assignments preceding the command name persist after executing colon (unless executed via command), but not after executing true.

  • In shell implementations where true is not provided as a built-in, using colon avoids the overheads associated with executing an external utility.

On page 3318 line 111746 section true, replace the contents of RATIONALE with:
None.

On page 3318 line 111752 section true, add colon and command to SEE ALSO.

On page 2389 line 76461 section colon, change APPLICATION USAGE from:
None.
to:
See the APPLICATION USAGE for true.

On page 2390 line 76479 section colon, add true to SEE ALSO.

Issue History

Date Modified Username Field Change
2023-03-12 07:00 kre New Issue
2023-03-12 07:00 kre Name => Robert Elz
2023-03-12 07:00 kre Section => XCU 3 / true
2023-03-12 07:00 kre Page Number => 3318
2023-03-12 07:00 kre Line Number => 111745 - 111748
2023-03-12 16:54 stephane Note Added: 0006202
2023-03-16 15:54 geoffclare Note Added: 0006206
2023-03-16 15:55 geoffclare Interp Status => ---
2023-03-16 15:55 geoffclare Final Accepted Text => 0001640:0006206
2023-03-16 15:55 geoffclare Status New => Resolved
2023-03-16 15:55 geoffclare Resolution Open => Accepted As Marked
2023-03-16 15:55 geoffclare Tag Attached: tc3-2008
2023-05-16 11:09 geoffclare Status Resolved => Applied
2023-05-16 11:10 geoffclare Tag Attached: applied_after_i8d3
2024-06-11 09:07 agadmin Status Applied => Closed