I have a shell script with the following fragment in it:
| tee $TFILE | more
If I quit more(1) before output from tee(1) is complete, I want to
s*$TFILE, else I want to move it to another name. I've tried
| ( trap 'rm $TFILE' 13; tee ) | more;
mv $TFILE othername
and
| ( tee ; mv $TFILE othername) | more
but in both cases the move occurs regardless of completion (in the second
case, the "mv" seems to be executing even after shell script has exited).
Any smart tricks?
----------------------
Charles Lambert