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_part
>> done

> That's actually a neat idea, I'll see if I can adapt this
> for my purpose. But you must admit that having a modified
> 'head' to replace the od/test/echo/printf part would be a
> nice thing?

Well I'm much less convinced now after realizing
that it didn't allow for a general solution.
Note the `od` above might seem a bit obtuse,
but it's really equivalent to and follows from
`head -c1 | hexdump`

cheers,
Pádraig.

Reply via email to