[Top][All Lists]

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

Re: RFE: head,tail: -z, --zero-terminated

From: Bernhard Voelker
Subject: Re: RFE: head,tail: -z, --zero-terminated
Date: Sun, 27 Sep 2015 10:54:10 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0

Adding <address@hidden>.

On 09/26/2015 04:43 PM, Richard Russon wrote:
> I'd like to add an option to both head and tail,
> to allow them to work with NUL-terminated lines of text
>      -z, --zero-terminated
> Thus allowing:
>      find dir -type f -print0 | head -z -n 10 | xargs -0 command

While this makes sense in head(1) and tail(1), wouldn't it also
make sense in find(1) to define a limit for the number of entries
returned, thus avoiding the 2 pipes at all?

  find dir -type f -limit 10 -exec command '{}' +

We already have other limiting options like -maxdepth, so a new option
to stop processing after a total number of output entries may be worth
thinking about.

Have a nice day,

reply via email to

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