bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#13243: closed (Re: bug#13243: [PATCH] enhancement: modify md5sum to


From: Bernhard Voelker
Subject: bug#13243: closed (Re: bug#13243: [PATCH] enhancement: modify md5sum to allow piping)
Date: Sat, 22 Dec 2012 14:26:20 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0

On 12/21/2012 12:12 AM, Daniel Santos wrote:
> On 12/20/2012 11:49 PM, Eric Blake wrote:
>> dd if=/dev/sda3 | pbzip2 -c2 | tee >(md5sum > /tmp/sda3.dat.bzip2.md5) |
>> netcat 192.168.1.123 45678

> Wow! It was worth writing a patch just to discover the >(list) and 
> <(list) constructs.  I knew about tee, but I had no idea about this, 
> thanks!! I've even known how to do this across programs written in C, I 
> just didn't know there was a bash mechanism for it.  So I guess bash 
> substitutes the parameter name with the /dev/fd<n> or some such for the 
> named pipe it creates?  I'll have to read up on it more.

Without bash, you can do it manually with a named pipe:

  mkfifo /tmp/fifo

  md5sum /tmp/fifo > /tmp/sda3.dat.bzip2.md5 &

  dd if=/dev/sda3 | pbzip2 -c2 | tee > /tmp/fifo |
  netcat 192.168.1.123 45678

Have fun,
Berny





reply via email to

[Prev in Thread] Current Thread [Next in Thread]