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
0000877 [1003.1(2013)/Issue7+TC1] Shell and Utilities Editorial Enhancement Request 2014-09-18 12:47 2020-04-03 14:55
Reporter joerg View Status public  
Assigned To
Priority normal Resolution Accepted As Marked  
Status Applied  
Name Jörg Schilling
User Reference
Section tail
Page Number 3239
Line Number 108597-108742
Interp Status ---
Final Accepted Text Note: 0002425
Summary 0000877: tail should support the -r option
Description UNIX systems include support for tail -r since at least 1980.
The POSIX standard should follow existing practice.
Desired Action Change line 108600 from:

       tail [−f] [−c number|−n number] [file]
       tail [−f | -r] [−c number|−n number] [file]

After line 108631 add:

     -r Reverse. Copies lines from the specified starting
            point in the file in reverse order. The default for r
            is to print the entire file in reverse order.
Tags issue8
Attached Files

- Relationships

-  Notes
geoffclare (manager)
2014-10-23 16:35
edited on: 2014-10-30 15:18

On page 3239 line 108600 change from:
tail [-f] [-c number|-n number] [file]
tail [-f] [-c number|-n number] [file]
tail -r [-n number] [file]

On page 3239 lines 108629-108632 change from:
-n number
This option shall be equivalent to -c number, except the starting location in the file shall be measured in lines instead of bytes. The origin for counting shall be 1; that is, -n +1 represents the first line of the file, -n -1 the last.

If neither -c nor -n is specified, -n 10 shall be assumed.
-n number
If -r is not specified, this option shall be equivalent to -c number, except the starting location in the file shall be measured in lines instead of bytes. The origin for counting shall be 1; that is, -n +1 represents the first line of the file, -n -1 the last.

If -r is specified, number shall specify the number of lines to read (in reverse) from the end of the input file. The application shall ensure that number does not have a sign.

Copy the lines in reverse order (last line first). If -n is specified, that many lines of the file, starting with the last line, shall be copied. If -n is not specified, every line of the input file shall be copied.

If none of the -c, -n or -r options is specified, -n 10 shall be assumed.

After line 108722 (page 3242), add a new paragraph to RATIONALE:

The functionality made available by tail -r has been historically provided on some systems by a separate utility (tac), although tac traditionally lacked support for -n to limit the output. While both <tt>tail -n$n | tac</tt> and <tt>tac | head -n$n</tt> can be used to output a fixed length of reversed line output, the standard developers decided that it was preferable to have a single utility <tt>tail -r -n$n</tt> for the same purpose. Furthermore, in deciding whether to standardize tac rather than tail -r, it was determined that more implementations that have achieved POSIX certification had already implemented tail -r as an extension.

shware_systems (reporter)
2014-10-23 18:00

I feel this should be tagged as Issue 8. As the proposal is a compromise of existing practice, as I heard the discussion, doesn't it need a sponsor and new reference implementation, or a citation of an existing reference implementation?
eblake (manager)
2014-10-23 18:34

Correct - since not all implementations support it yet, it must be Issue 8. However, among all implementations that currently support it, the proposal here captures the existing behavior, so those implementations serve as the reference implementation and we do not need any additional sponsor to standardize existing practice.
eblake (manager)
2014-10-23 22:44

Should we also add text to XRAT C.4.3 (page 3712, near line 127098) that explains why we chose 'tail -r' instead of 'tac' as the interface to standardize?

- Issue History
Date Modified Username Field Change
2014-09-18 12:47 joerg New Issue
2014-09-18 12:47 joerg Name => Jörg Schilling
2014-09-18 12:47 joerg Section => tail
2014-09-18 12:47 joerg Page Number => 3239
2014-09-18 12:47 joerg Line Number => 108597-108742
2014-10-23 16:35 geoffclare Note Added: 0002425
2014-10-23 16:36 geoffclare Note Edited: 0002425
2014-10-23 18:00 shware_systems Note Added: 0002426
2014-10-23 18:34 eblake Note Added: 0002427
2014-10-23 22:44 eblake Note Added: 0002428
2014-10-30 15:08 shware_systems Tag Attached: issue8
2014-10-30 15:18 geoffclare Note Edited: 0002425
2014-10-30 15:19 geoffclare Interp Status => ---
2014-10-30 15:19 geoffclare Final Accepted Text => Note: 0002425
2014-10-30 15:19 geoffclare Status New => Resolved
2014-10-30 15:19 geoffclare Resolution Open => Accepted As Marked
2020-04-03 14:55 geoffclare Status Resolved => Applied

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