Sujet : Re: Are We Back to the "Wars" Now ?
De : fritz (at) *nospam* spamexpire-202411.rodent.frell.theremailer.net (Fritz Wuehler)
Groupes : comp.os.linux.miscDate : 23. Nov 2024, 22:32:37
Autres entêtes
Organisation : dizum.com - The Internet Problem Provider
Message-ID : <8dd3cea92696338fe22c059158645628@msgid.frell.theremailer.net>
References : 1 2 3 4 5 6 7 8 9
Carlos E.R. <
robin_lis...@es.invalid> [CE]:
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's
process substitution feature instead:
dd if=/dev/$1 status=progress bs=16M |
tee >(md5sum -b >> md5checksum_expanded) \
>(pigz -3 > $3.gz) \
>/dev/null