My approach would have been to use "split" on the original file and then dd the resulting files. But now I find myself wondering how old "split" is. It was certainly already a well-established thing by the early 90s. On Mon, Jun 26, 2023 at 11:23 PM Ralph Corderoy wrote: > Hi Steve, > > > I’ve never figured out how to use ‘dd’ so it returns after a single > > block is written doesn’t close the input, killing the pipeline, or > > cause the rest of the data to be discarded. > > I think this meets your description and complies with POSIX's dd(1p) > here. > > $ seq 33 126 | sed 's/$/P/' | dc | > > while :; do > > LC_ALL=C dd bs=10 count=1 2>dd.err | sed -n l > > grep -q '^[^0].* records in$' dd.err || break > > done > !"#$%&'()*$ > +,-./01234$ > 56789:;<=>$ > ?@ABCDEFGH$ > IJKLMNOPQR$ > STUVWXYZ[\\$ > ]^_`abcdef$ > ghijklmnop$ > qrstuvwxyz$ > {|}~$ > $ > $ rm dd.err > > I set the locale so the format of dd's stderr report is known. > > -- > Cheers, Ralph. >