[clug] using 'dd' in a pipeline (linux Digest, Vol 143, Issue 21, Message 1)

steve jenkin sjenkin at canb.auug.org.au
Mon Nov 24 15:18:00 MST 2014


Miles,

Thanks very much for the suggestion. I did not know that option of ‘dd’.

I changed the command to: "(dd iflag=nonblock bs=$bs count=$blocks ;echo $? >&2) |md5sum -“

but didn’t see anything different. Exit status still 0, and "0+0 records in, 0+0 records out, 0 bytes (0 B) copied, 6.7e-05 s, 0.0 kB/s”

again, many thanks.

steve

On 24 Nov 2014, at 10:14 pm, Miles Goodhew <mgoodhew at gmail.com> wrote:

> What about:
> 
> % (something) | dd iflag=nonblock | (something else)
> 
>   Sets rc != 0 on short read and you get "dd: reading `standard input': Resource temporarily unavailable" on stdout.
>   Is that the sort of thing you're after? "noctty" may have an effect too, depending on what else is in the pipeline. Not entirely sure what you want from the script that you're not getting from it currently (and where the "blocks" variable comes from/is set to)
> 
> M0les.

--


More information about the linux mailing list