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.

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to