Liste des Groupes | Revenir à col misc |
Carlos E.R. <robin_lis...@es.invalid> [CE]:it is not.
CE> I dd a hard disk partition, compress it, and at the same time
CE> calculate a checksum.
CE>
CE> mkfifo mdpipe
CE> dd if=/dev/$1 status=progress bs=16M | tee mdpipe | pigz -3 > $3.gz &
CE> md5sum -b mdpipe | tee -a md5checksum_expanded
CE> wait
CE> rm mdpipe
CE> echo "$3" >> md5checksum_expanded
David B Rosen has written the tpipe(1) utility for exactly such cases:
The above steps can be rewritten in a much cleaner way as:
dd if=/dev/$1 status=progress bs=16M |
tpipe "md5sum -b >> md5checksum_expanded" |
pigz -3 > $3.gz
If tpipe is not available on your system,
you can always use the shell'sI like my way, it is mine :-)
process substitution feature instead:
dd if=/dev/$1 status=progress bs=16M |
tee >(md5sum -b >> md5checksum_expanded) \
>(pigz -3 > $3.gz) \
>/dev/null
Les messages affichés proviennent d'usenet.