It is often convinient to detect whether head has in fact printed the
requested number of lines or if EOF was reached before reaching that
point. This patch adds the option --indicate-underrun, which makes
"head" exit with a status of 4 instead of 0 if no more data could be
read from its input.
Th
Dies schrieb Stefan Tomanek (stefan.toma...@wertarbyte.de):
> It is often convinient to detect whether head has in fact printed the
> requested number of lines or if EOF was reached before reaching that
> point. This patch adds the option --indicate-underrun, which makes
> "head" exit with a statu
On 23/11/10 16:24, Stefan Tomanek wrote:
> Dies schrieb Stefan Tomanek (stefan.toma...@wertarbyte.de):
>
>> It is often convinient to detect whether head has in fact printed the
>> requested number of lines or if EOF was reached before reaching that
>> point. This patch adds the option --indicate-
Pádraig Brady wrote:
> On 23/11/10 16:24, Stefan Tomanek wrote:
>> Dies schrieb Stefan Tomanek (stefan.toma...@wertarbyte.de):
>>
>>> It is often convinient to detect whether head has in fact printed the
>>> requested number of lines or if EOF was reached before reaching that
>>> point. This patch
Dies schrieb Jim Meyering (j...@meyering.net):
> > This does seem useful on the face of it.
> > I need to do a little further investigation
> > to see if there are existing ways to achieve the same.
>
> For the record, here's a quick one-liner:
>
> $ seq 2|perl -ne '$n=3; print; $.==$n and $ok
On 23/11/10 16:34, Pádraig Brady wrote:
> On 23/11/10 16:24, Stefan Tomanek wrote:
>> Dies schrieb Stefan Tomanek (stefan.toma...@wertarbyte.de):
>>
>>> It is often convinient to detect whether head has in fact printed the
>>> requested number of lines or if EOF was reached before reaching that
>>>
Dies schrieb Pádraig Brady (p...@draigbrady.com):
> I was wondering about the logic in your example BTW.
> If there is no input then you'll process an empty chunk
> or if the input is an exact multiple of the chunk size
> you'll process an empty chunk at the end.
Yes, I have to admit that this is
On 25/11/10 16:17, Stefan Tomanek wrote:
> Dies schrieb Pádraig Brady (p...@draigbrady.com):
>
>> process_part() { echo processing $(wc -c) bytes; }
>> while true; do
>> c=$(od -tx1 -An -N1)
>> test "$c" || break
>> c=$(echo $c) #strip leading ' '
>> { printf "\x$c"; head -c9; } | process_
On 24/11/10 16:34, Pádraig Brady wrote:
> On 23/11/10 16:34, Pádraig Brady wrote:
>> On 23/11/10 16:24, Stefan Tomanek wrote:
>>> Dies schrieb Stefan Tomanek (stefan.toma...@wertarbyte.de):
>>>
It is often convinient to detect whether head has in fact printed the
requested number of lines