I/O Redirection quest. Summary

David Smith dwsmith at loki.arc.NASA.GOV
Wed Apr 17 07:42:59 AEST 1991


In summary:

Problem:
Need to capture stdout in a file along with stderr, but also need stdout to
go to the terminal for prompting of input.


Solution:

sh/ksh:

(program | tee /dev/tty) > file 2>&1

csh:

(program | tee /dev/tty) >& file


Thank you to everyone who responded to my question.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  David W. Smith   				All comments made are my own
  NASA Ames Research Center			and do not in anyway reflect
  M/S 233-3					NASA opinions or policies.
  Moffett Field, CA 94035-1000
  (415) 604-6555
			
  Internet: dwsmith at ames.arc.nasa.gov
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



More information about the Comp.unix.shell mailing list