tee
PURPOSE
Displays the output of a program and copies it into a
file.
SYNOPSIS
tee [ -i ] [ -a ] [ file ] ...
DESCRIPTION
The tee command reads standard input and writes the
output of a program to standard output and copies it into
file at the same time.
FLAGS
-a Adds the output to the end of file instead of writing
over it.
-i Ignores interrupts.
Note: If you specify both flags, each must appear sepa-
rately on the command line, preceded by a - (minus).
EXAMPLES
1. To view and save the output from a command at the
same time:
lint program.c | tee program.lint
This displays the standard output of the command
"lint program.c" at the work station, and at the same
time saves a copy of it in the file "program.lint".
If "program.lint" already exists, it is deleted and
replaced.
2. To display and append to a file:
lint program.c | tee -a program.lint
This displays the standard output of "lint program.c"
at the work station and at the same time appends a
copy of it to the end of "program.lint". If the file
"program.lint" does not exist, it is created.