GNU bug report logs -
#12115
Please add tip about using tac to reverse a file byte-by-byte
Previous Next
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
Message #61 received at 12115-done <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 02/01/2013 02:43 PM, Reuben Thomas wrote:
> On 1 February 2013 21:36, Paul Eggert <eggert <at> cs.ucla.edu> wrote:
>
>> On 02/01/13 11:14, Reuben Thomas wrote:
>>
>>> Given how long it took how many experts to come up with a valid
>>> incantation, it seems to me it *is* a useful documentation example.
>>
>> Sure, but the valid incantation is a bit confusing, and it's not
>> documented correctly (it reverses characters, not bytes).
>> As far as I know there's no portable way to use 'tac' to
>> reverse a file byte-by-byte.
Use LC_ALL=C to force single-byte characters.
>>
>
> Thanks!
>
> What about a way to do it on a GNU system? It seems reasonable to document
> GNU-specific hacks in GNU documentation when a portable solution is not
> forthcoming.
tac is a GNU program not standardized elsewhere, so if you have tac, it
is likely GNU tac to begin with.
The manual already contains:
@example
# Reverse a file character by character.
tac -r -s 'x\|[^x]'
@end example
Do we need a further example, or just modify that existing example to
call out the use of LC_ALL=C for reversing by bytes instead of characters?
--
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 12 years and 115 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.