Transmit data from stdin to stdout,
print throughput statistics on stderr.
features, all optional:
- throughput statistics contiguously printed
- throttle data transmission to a given limit
- skip initial data, stop after a given amount of data
- spill data on internal buffer overflow
nota bene:
The two options --count and --skip where introduced to
allow precise input file cut out. Usually, this is done
also by dd(1), with options skip=, bs= and count=, but due
to its block oriented nature, dd(1) may produce less
than the desired count * bs bytes. This is a result of
the aibility of character devices to return any read(2)
access short, that is, when asked for a specific amount of
data, return with less than this number of bytes, yet not
erroneous. To observe this behaviour, try:
jetcat -w 23 42 </dev/zero | dd bs=100 count=10 | wc -c
The result should most probably be 230 bytes counted,
while on a first glance dd(1) was assumed to transmit
1000 bytes. dd(1) reports the short read(2) results next
to the +:
0+10 records in
The solution is either to use head(1) and tail(1) to cut
out portions of a file, or jetcat. Instead of
dd bs=x skip=y count=z
one of the following two sequences might be used:
head -c (y+z)*x | tail -c z*x
jetcat -f 0 -s y*x -c z*x 2>/dev/null
|