Austin Group Defect Tracker

Aardvark Mark IV


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0000971 [1003.1(2008)/Issue 7] Shell and Utilities Objection Error 2015-07-22 17:26 2019-06-10 08:54
Reporter sebor View Status public  
Assigned To ajosey
Priority normal Resolution Accepted As Marked  
Status Closed  
Name Martin Sebor
Organization
User Reference
Section join
Page Number 2839
Line Number 93313-93315, 93389-93391
Interp Status ---
Final Accepted Text See Note: 0002772.
Summary 0000971: join -t separator underspecified, example incorrect
Description The join utility -t option takes a character argument that specifies the separator between fields on which to perform the join. There is no description of the format in which the character may be specified (for example, whether it can be an escape sequence, as in \t, or a character class such as [:blank:], similarly to how tr interprets characters in its operands), suggesting that no special formats are accepted.

However, the EXAMPLES section shows the following invocation of the utility:

  join -t "<tab>" -a 1 -a 2 -e '(unknown)' -o 0,1.2,2.2 phone fax

Note the "<tab>". I've only tried two implementations of join but neither recognizes "<tab>" as representing the
<TAB> character. Instead, both implementations simply treat the leading '<' as the separator and ignore the rest.

Unless the example reflects an intent that join accept other separators besides ordinary characters, it will not behave as described.
Desired Action Since there doesn't seem to be any evidence that the utility is expected to map a symbolic character name in the argument to the -t option to the corresponding character, the example should be changed to show how the utility can be invoked to obtain the expected output.

In addition, the standard should be specific about what format the -t argument is required or permitted to be in and what implementations should do when it is not in the expected format. If the behavior is to be left unspecified when the argument is not a single character, it would be nice to make that explicit and encourage implementations to provide more useful behavior than simply ignoring everything past the first character. (For example, issuing a diagnostic would be a useful extension, as would treating the argument the same way tr does.)
Tags tc2-2008
Attached Files

- Relationships

-  Notes
(0002771)
shware_systems (reporter)
2015-07-22 21:24

The use of <tab> there is a documentation convention that represents an ASCII 0x9 being input directly, not a 5 character sequence the utility or shell is expected to map to 0x9, to match the usage of the line above describing the files.

To match existing practice the wording probably should be, in line 93313:

-t Use the first character, possibly multi-byte, of operand char as a separator,...

What is allowed as a first character is specified by LC_CTYPE settings and how the shell parses quoted and unquoted tokens, that I see. This is covered by the references already present, imo. Per the description of sh, an error code of 1 to 125 is to be returned for syntax errors, which an illegal character would be a case of when encountered in a script.
(0002772)
Don Cragun (manager)
2015-07-23 15:08

Change P2841, L93392 from:
would produce:

to:
(where <tt><tab></tt> is a literal <tab> character) would produce:

- Issue History
Date Modified Username Field Change
2015-07-22 17:26 sebor New Issue
2015-07-22 17:26 sebor Status New => Under Review
2015-07-22 17:26 sebor Assigned To => ajosey
2015-07-22 17:26 sebor Name => Martin Sebor
2015-07-22 17:26 sebor Section => join
2015-07-22 17:26 sebor Page Number => 2839
2015-07-22 17:26 sebor Line Number => 93313-93315, 93389-93391
2015-07-22 21:24 shware_systems Note Added: 0002771
2015-07-23 15:08 Don Cragun Note Added: 0002772
2015-07-23 15:09 Don Cragun Interp Status => ---
2015-07-23 15:09 Don Cragun Final Accepted Text => See Note: 0002772.
2015-07-23 15:09 Don Cragun Status Under Review => Resolved
2015-07-23 15:09 Don Cragun Resolution Open => Accepted As Marked
2015-07-23 15:09 Don Cragun Tag Attached: tc2-2008
2019-06-10 08:54 agadmin Status Resolved => Closed


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker