getconf: don't include xpg4 bits, gcc7 includes xpg6 bits for us
[unleashed.git] / share / man / man1 / tee.1
blobe7b619e306d20a5301ea1a97e3c79ebf6f87711a
1 .\"
2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
6 .\"
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
9 .\" documentation.
10 .\"
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
13 .\"
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group.  In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document.  The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
24 .\"
25 .\" This notice shall appear on any product containing this material.
26 .\"
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
30 .\"
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
35 .\"
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
41 .\"
42 .\"
43 .\" Copyright 1989 AT&T
44 .\" Copyright (c) 1992, X/Open Company Limited.  All Rights Reserved.
45 .\" Portions Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved
46 .\"
47 .TH TEE 1 "Nov 20, 2007"
48 .SH NAME
49 tee \- replicate the standard output
50 .SH SYNOPSIS
51 .SS "/usr/bin/tee"
52 .LP
53 .nf
54 \fB/usr/bin/tee\fR [\fB-ai\fR] [\fIfile\fR]...
55 .fi
57 .SS "ksh93"
58 .LP
59 .nf
60 \fBtee\fR [\fB-ail\fR] [\fIfile\fR]...
61 .fi
63 .SH DESCRIPTION
64 .SS "/usr/bin/tee"
65 .sp
66 .LP
67 \fB/usr/bin/tee\fR copies standard input to standard output, making a copy in
68 zero or more files. \fBtee\fR does not buffer its output. The options determine
69 if the specified files are overwritten or appended to.
70 .SS "ksh93"
71 .sp
72 .LP
73 The \fBtee\fR built-in in \fBksh93\fR is associated with the \fB/bin\fR and
74 \fB/usr/bin\fR paths. It is invoked when tee is executed without a pathname
75 prefix and the pathname search finds a \fB/bin/tee\fR or \fB/usr/bin/tee\fR
76 executable.
77 .sp
78 .LP
79 \fBtee\fR copies standard input to standard output and to zero or more files.
80 The options determine whether the specified files are overwritten or appended
81 to. The tee utility does not buffer output. If a write to a file fails,
82 \fBtee\fR continues to write to other files although it exits with a non-zero
83 exit status.
84 .sp
85 .LP
86 The number of \fIfile\fR operands that can be specified is limited by the
87 underlying operating system.
88 .SH OPTIONS
89 .SS "/usr/bin/tee"
90 .sp
91 .LP
92 The following options are supported by \fB/usr/bin/tee\fR:
93 .sp
94 .ne 2
95 .na
96 \fB\fB-a\fR\fR
97 .ad
98 .RS 6n
99 Appends the output to the files rather than overwriting them.
103 .ne 2
105 \fB\fB-i\fR\fR
107 .RS 6n
108 Ignores interrupts.
111 .SS "ksh93"
114 The following options are supported by the \fBtee\fR built-in command in
115 \fBksh93\fR:
117 .ne 2
119 \fB\fB-a\fR\fR
123 \fB\fB--append\fR\fR
125 .RS 23n
126 Appends the output to the files rather than overwriting them.
130 .ne 2
132 \fB\fB-i\fR\fR
136 \fB\fB--ignore-interrupts\fR\fR
138 .RS 23n
139 Ignores \fBSIGINT\fR signal.
143 .ne 2
145 \fB\fB-l\fR\fR
149 \fB\fB--line-buffer\fR\fR
151 .RS 23n
152 Sets the standard output to be line buffered.
155 .SH OPERANDS
158 The following operands are supported:
160 .ne 2
162 \fB\fIfile\fR\fR
164 .RS 8n
165 A path name of an output file. Processing of at least 13 \fIfile\fR operands
166 are supported.
169 .SH USAGE
172 See \fBlargefile\fR(5) for the description of the behavior of \fBtee\fR when
173 encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
174 .SH ENVIRONMENT VARIABLES
177 See \fBenviron\fR(5) for descriptions of the following environment variables
178 that affect the execution of \fBtee\fR: \fBLANG\fR, \fBLC_ALL\fR,
179 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
180 .SH EXIT STATUS
181 .SS "/usr/bin/tee"
184 The following exit values are returned by \fB/usr/bin/tee\fR:
186 .ne 2
188 \fB\fB0\fR\fR
190 .RS 6n
191 The standard input was successfully copied to all output files.
195 .ne 2
197 \fB\fB>0\fR\fR
199 .RS 6n
200 The number of files that could not be opened or whose status could not be
201 obtained.
204 .SS "ksh93"
207 The following exit values are returned by \fBtee\fR in \fBksh93\fR:
209 .ne 2
211 \fB\fB0\fR\fR
213 .RS 6n
214 Successful completion.
218 .ne 2
220 \fB\fB>0\fR\fR
222 .RS 6n
223 An error occurred.
226 .SH ATTRIBUTES
229 See \fBattributes\fR(5) for descriptions of the following attributes:
230 .SS "/usr/bin/tee"
235 box;
236 c | c
237 l | l .
238 ATTRIBUTE TYPE  ATTRIBUTE VALUE
240 CSI     Enabled
242 Interface Stability     Committed
244 Standard        See \fBstandards\fR(5).
247 .SS "ksh93"
252 box;
253 c | c
254 l | l .
255 ATTRIBUTE TYPE  ATTRIBUTE VALUE
257 Interface Stability     See below.
262 The \fBksh93\fR built-in binding to \fB/bin\fR and \fB/usr/bin\fR is Volatile.
263 The built-in interfaces are Uncommitted.
264 .SH SEE ALSO
267 \fBcat\fR(1), \fBksh93\fR(1), \fBattributes\fR(5), \fBenviron\fR(5),
268 \fBlargefile\fR(5), \fBstandards\fR(5)