Sample Header Ad - 728x90

dd bs=X count=1 reads less than X bytes

0 votes
1 answer
636 views
I have dd from GNU coreutils 8.32. When I run { echo a; sleep 1; echo b; } | dd bs=4 count=1 then I get a 0+1 records in 0+1 records out 2 bytes copied, 2.0381e-05 s, 98.1 kB/s dd terminates during the sleep even though the block size was not reached and there was no EOF. The output b\n is lost. This does not happen if I remove either sleep or count=1. In man dd I couldn't find anything that describes this behavior. 1. Why doesn't dd count=1 wait till bs is reached or an EOF is encountered? 2. How can I force dd to wait?
Asked by Socowi (645 rep)
Mar 15, 2021, 03:43 PM
Last activity: Mar 15, 2021, 05:39 PM