GNU bug report logs - #18808
tail: implement 'tail -r' as synonym for 'tac'

Previous Next

Package: coreutils;

Reported by: Eric Blake <eblake <at> redhat.com>

Date: Thu, 23 Oct 2014 16:40:03 UTC

Severity: wishlist

Full log


Message #8 received at 18808 <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: 18808 <at> debbugs.gnu.org
Subject: Re: bug#18808: implement 'tail -r' as synonym for 'tac'
Date: Thu, 23 Oct 2014 10:53:13 -0600
[Message part 1 (text/plain, inline)]
On 10/23/2014 10:39 AM, Eric Blake wrote:
> POSIX is considering standardizing the Solaris/BSD behavior of 'tail -r'
> rather than adding the GNU extension of 'tac' as a separate utility:
> http://austingroupbugs.net/view.php?id=877
> 
> This bug report serves as a reminder that we need to add 'tail -r'
> support to coreutils, as well as a request for reviewers for the current
> state of the proposal to make sure that it is not an onerous burden for
> adding that code.
> 

Implementation-wise, I'm thinking the easiest thing might be to turn
tac.c into a shared library-style file (similar to how copy.c is shared
among multiple programs), add a 'tac -n' option that limits output to a
fixed number of "lines" (or rather, a fixed number of occurrences of
'--separator'-delimited segments), then have the new 'tail -r' call into
the library code with separator hard-coded to newline, along with
sufficient checks that tail's new -r can only be used with -n with no
sign on the number (at least, as a first cut; we can certainly support
more combinations than what POSIX wants to require, if we can determine
sane semantics and easy implementations for those combinations).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 6 years and 243 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.