coreutils
[Top][All Lists]
Advanced

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

Re: Splitting search results from a "find -print0"


From: Pádraig Brady
Subject: Re: Splitting search results from a "find -print0"
Date: Thu, 08 Jan 2015 10:58:36 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0

On 08/01/15 05:00, Dylan Cali wrote:
> On Wed, Jan 7, 2015 at 10:54 PM, Dylan Cali <address@hidden> wrote:
>> Maybe I've misunderstood the problem but you can also accomplish this with:
>>
>> find -print0 | xargs -n3 -0 | split -l3
> 
> Actually I guess it should be -n1
> 
> find -print0 | xargs -n1 -0 | split -l3

Yes, that's essentially converting \0 to \n
and so is equivalent to (but doesn't distinguish embedded newlines):

  find -print0 | tr '\n\0' '\0\n' | split -l3

The proposed patch avoids the translation around the split process.
Note also that some split functionality depends on working on
seekable files, which is the main reason in my mind to
not rely on external translation around split(1).

thanks,
Pádraig.



reply via email to

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