GNU bug report logs - #12115
Please add tip about using tac to reverse a file byte-by-byte

Previous Next

Package: coreutils;

Reported by: Reuben Thomas <rrt <at> sc3d.org>

Date: Wed, 1 Aug 2012 21:46:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eric Blake <eblake <at> redhat.com>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: 12115 <at> debbugs.gnu.org
Subject: bug#12115: Please add tip about using tac to reverse a file byte-by-byte
Date: Wed, 01 Aug 2012 15:50:18 -0600
[Message part 1 (text/plain, inline)]
On 08/01/2012 03:37 PM, Reuben Thomas wrote:
> Patch:
> 
>>From 3c1b7d442dc6161e3c88703c9acc3f768f9ba689 Mon Sep 17 00:00:00 2001
> From: Reuben Thomas <rrt <at> sc3d.org>
> Date: Wed, 1 Aug 2012 22:35:38 +0100
> Subject: [PATCH] doc: Add tip on reversing a file byte-by-byte
> 
> * doc/coreutils.texi: Note how to use tac to reverse a file
> byte-by-byte.
> ---
>  doc/coreutils.texi |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/doc/coreutils.texi b/doc/coreutils.texi
> index 516ec73..66b0838 100644
> --- a/doc/coreutils.texi
> +++ b/doc/coreutils.texi
> @@ -1625,6 +1625,12 @@ Use @var{separator} as the record separator,
> instead of newline.
> 
>  @end table
> 
> +To reverse a file byte by byte, use:
> +
> +@example
> +tac -r -s '.\| ' @var{file}

Cool tip.  But not quite accurate - you need a literal newline instead
of a space on the other side of that regex alternation.

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

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

This bug report was last modified 12 years and 114 days ago.

Previous Next


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