bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Eric Blake
Subject: bug#12115: Please add tip about using tac to reverse a file byte-by-byte
Date: Thu, 02 Aug 2012 07:28:10 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0

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\\|.')"

-- 
Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]