|TEE(1P)||POSIX Programmer's Manual||TEE(1P)|
tee [-ai] [file...]
If the -a option is not specified, output files shall be written (see Section 184.108.40.206, File Read, Write, and Creation.
The following options shall be supported:
- Append the output to the files.
- Ignore the SIGINT signal.
- A pathname of an output file. If a file operand is '-', it shall refer to a file named -; implementations shall not treat it as meaning standard output. Processing of at least 13 file operands shall be supported.
- Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of POSIX.1‐2017, Section 8.2, Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.)
- If set to a non-empty string value, override the values of all the other internationalization variables.
- Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments).
Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.
- Determine the location of message catalogs for the processing of LC_MESSAGES.
- The standard input was successfully copied to all output files.
- An error occurred.
The following sections are informative.
The file operand is technically optional, but tee is no more useful than cat when none is specified.
... | tee unsorted | sort > sorted
It should be noted that early versions of BSD ignore any invalid options and accept a single '-' as an alternative to -i. They also print a message if unable to open a file:
"tee: cannot access %s\n", <pathname>
Historical implementations ignore write errors. This is explicitly not permitted by this volume of POSIX.1‐2017.
Some historical implementations use O_APPEND when providing append mode; others use the lseek() function to seek to the end-of-file after opening the file without O_APPEND. This volume of POSIX.1‐2017 requires functionality equivalent to using O_APPEND; see Section 220.127.116.11, File Read, Write, and Creation.
The Base Definitions volume of POSIX.1‐2017, Chapter 8, Environment Variables, Section 12.2, Utility Syntax Guidelines
The System Interfaces volume of POSIX.1‐2017, lseek()
Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
|2017||IEEE/The Open Group|