piping to/from shell script

piping to/from shell script

Post by Don Mendelso » Fri, 11 Jul 1997 04:00:00



Is anyone familiar with how to deal with piped, block input to a C Shell
script?  Any guidance would be greatly appreciated.

 
 
 

1. Detecting pipe closure in shell script

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
scrap $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

2. Printers Not on the List

3. pipe to a shell script

4. question on kdebug.

5. Pipe in a Shell-Script

6. Using Macall 2Btn. Mouse with LinuxPPC 1999?

7. Why is ^C ignored when I use a pipe within my shell script?

8. Setting $KDEDIR ?

9. MMDF Alias piping to a shell script

10. a question about 'read' from pipe in shell script

11. shell script style question: pipe or redir to file

12. pipe output from c program to a korn shell script

13. Piping output to a C-shell script from another command - HOW?