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


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

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Eric Blake <eblake <at> redhat.com>
Cc: "12115 <at> debbugs.gnu.org" <12115 <at> debbugs.gnu.org>,
	Jim Meyering <jim <at> meyering.net>, "Voelker,
	Bernhard" <bernhard.voelker <at> siemens-enterprise.com>,
	Reuben Thomas <rrt <at> sc3d.org>
Subject: Re: bug#12115: Please add tip about using tac to reverse a file
	byte-by-byte
Date: Thu, 02 Aug 2012 16:00:43 +0200
Eric Blake <eblake <at> redhat.com> writes:

> On 08/02/2012 07:18 AM, Andreas Schwab wrote:
>>> For bash, one solution is:
>>>
>>> 	$ printf '\na\nb'|tac -rs '.\|'$(printf "\n")
>> 
>> No, command substitution strips trailing newlines.
>
> So don't make it trailing:
>
> printf '\na\nb'|tac -rs "$(printf '\n\\|.')"

It's still a useless command substitution.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




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.