On Thu, Jun 21, 2018 at 3:57 AM, Maximilian Pichler <maxim.pich...@gmail.com> wrote: > On Thu, Jun 21, 2018 at 9:48 AM, Otto Moerbeek <o...@drijf.net> wrote: >>> On Thu, Jun 21, 2018 at 12:11:52AM +0200, Maximilian Pichler wrote: >>> > I'm just wondering what these other utilities might be. >>> >>> hexdump -v -n 1234567 -e '"%c"' > > Speed-wise this is roughly on par with 'dd bs=1'. > >>> If the input doesn't contain backslashes (or something else, tr(1)) >>> >>> vis -aoF6 | head -n 1234567 | unvis > > Backslashes exist. :) > >> Variation that buffers the writes: >> >> dd ibs=1 count=n > > Nice, this is about three time as fast as bs=1. Both are much slower > than 'ghead -c'. >
Reads buffered the first 5 chars from file: $ cat file | perl -ne 'BEGIN { $/ = \1 } print if $. <= 5; exit 0 if $. == 5' maetel$ kdump | grep read\(0 43509 perl CALL read(0,0xc9e9996f000,0x2000) maetel$ maetel$ kdump | grep write\(1 43509 perl CALL write(1,0xc9e0c6c5000,0x5) maetel$