Is there something about process substitution (which I think is implemented with unnamed pipes) that is incompatible with dd
?
For example, this fails:
$ dd if=<(unzip -p raspbian.zip) of=/dev/sdb status=progress
dd: unrecognized operand ‘/dev/fd/4’
Try 'dd --help' for more information.
But this works fine:
$ unzip -p raspbian.zip | dd of=/dev/sdb status=progress
108458496 bytes (108 MB) copied, 19.446285 s, 5.6 MB/s
Is the use of if
somehow implicitly telling dd
that it should be able to seek?
if
is implying that the input should be seekable. – jhfrontz Nov 14 '19 at 15:12dd
, which doesn't show up under bash. What shell do you use? – user3840170 Nov 14 '19 at 15:16cat
replacingunzip
(I don't have Zip archives) inbash
norzsh
on OpenBSD using either of GNUdd
or OpenBSDdd
. Did you originally have a space before the process substitution? That would make GNUdd
complain as you show. – Kusalananda Nov 14 '19 at 15:17dd if=<(echo foo) of=/dev/null
works for me, butdd if= <(echo foo) of=/dev/null
gives an errordd: unrecognized operand ‘/dev/fd/63’
similar to that described in the question. I don't know which shell will pick fd 4 for its first process substitution. Try alsoecho if=<(:)
to see if your shell is introducing a space where it shouldn't. – Toby Speight Nov 14 '19 at 15:43$ echo if=<(:)
producesif= /dev/fd/4
(with a rogue leading space). ARGH! – jhfrontz Nov 14 '19 at 17:29dd
on a pipe or to write to block devices. Just useunzip -p raspbian.zip > /dev/sdb
orunzip -p raspbian.zip | pv > /dev/sdb
if you want a progress status. – Stéphane Chazelas Nov 14 '19 at 17:46bs
parameter ofdd
to (perhaps vainly) optimize the drive I/O. – jhfrontz Nov 14 '19 at 18:57