[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
manually pipe processes
From: |
Brian J. Murrell |
Subject: |
manually pipe processes |
Date: |
Thu, 05 Mar 2009 12:28:00 -0500 |
Hi,
I want to effect this pipeline:
tar cf - /etc | tar xf - | tee /tmp/outfile
manually. It seems that some form of file descriptor manipulation (i.e.
moving, duplication, etc.) should be able to achieve this, but I can't
seem to figure it out.
Why would I want to do this? Because I want (specifically) the second
tar command to run in the background and I want to wait for it so that
the "trap" in the parent shell can process signals. Altogether I want:
#!/bin/bash
trap 'echo got HUP' HUP
(tar cf - /etc | tar xf - | tee /tmp/outfile) &
wait ${pid_of_second_tar}
and I want the trap processing to be immediate, not when the tar
pipeline finishes.
Ideas?
b.
signature.asc
Description: This is a digitally signed message part
- manually pipe processes,
Brian J. Murrell <=