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
  56 
  57 .SS "ksh93"
  58 .LP
  59 .nf
  60 \fBtee\fR [\fB-ail\fR] [\fIfile\fR]...
  61 .fi
  62 
  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.
 100 .RE
 101 
 102 .sp
 103 .ne 2
 104 .na
 105 \fB\fB-i\fR\fR
 106 .ad
 107 .RS 6n
 108 Ignores interrupts.
 109 .RE
 110 
 111 .SS "ksh93"
 112 .sp
 113 .LP
 114 The following options are supported by the \fBtee\fR built-in command in
 115 \fBksh93\fR:
 116 .sp
 117 .ne 2
 118 .na
 119 \fB\fB-a\fR\fR
 120 .ad
 121 .br
 122 .na
 123 \fB\fB--append\fR\fR
 124 .ad
 125 .RS 23n
 126 Appends the output to the files rather than overwriting them.
 127 .RE
 128 
 129 .sp
 130 .ne 2
 131 .na
 132 \fB\fB-i\fR\fR
 133 .ad
 134 .br
 135 .na
 136 \fB\fB--ignore-interrupts\fR\fR
 137 .ad
 138 .RS 23n
 139 Ignores \fBSIGINT\fR signal.
 140 .RE
 141 
 142 .sp
 143 .ne 2
 144 .na
 145 \fB\fB-l\fR\fR
 146 .ad
 147 .br
 148 .na
 149 \fB\fB--line-buffer\fR\fR
 150 .ad
 151 .RS 23n
 152 Sets the standard output to be line buffered.
 153 .RE
 154 
 155 .SH OPERANDS
 156 .sp
 157 .LP
 158 The following operands are supported:
 159 .sp
 160 .ne 2
 161 .na
 162 \fB\fIfile\fR\fR
 163 .ad
 164 .RS 8n
 165 A path name of an output file. Processing of at least 13 \fIfile\fR operands
 166 are supported.
 167 .RE
 168 
 169 .SH USAGE
 170 .sp
 171 .LP
 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
 175 .sp
 176 .LP
 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"
 182 .sp
 183 .LP
 184 The following exit values are returned by \fB/usr/bin/tee\fR:
 185 .sp
 186 .ne 2
 187 .na
 188 \fB\fB0\fR\fR
 189 .ad
 190 .RS 6n
 191 The standard input was successfully copied to all output files.
 192 .RE
 193 
 194 .sp
 195 .ne 2
 196 .na
 197 \fB\fB>0\fR\fR
 198 .ad
 199 .RS 6n
 200 The number of files that could not be opened or whose status could not be
 201 obtained.
 202 .RE
 203 
 204 .SS "ksh93"
 205 .sp
 206 .LP
 207 The following exit values are returned by \fBtee\fR in \fBksh93\fR:
 208 .sp
 209 .ne 2
 210 .na
 211 \fB\fB0\fR\fR
 212 .ad
 213 .RS 6n
 214 Successful completion.
 215 .RE
 216 
 217 .sp
 218 .ne 2
 219 .na
 220 \fB\fB>0\fR\fR
 221 .ad
 222 .RS 6n
 223 An error occurred.
 224 .RE
 225 
 226 .SH ATTRIBUTES
 227 .sp
 228 .LP
 229 See \fBattributes\fR(5) for descriptions of the following attributes:
 230 .SS "/usr/bin/tee"
 231 .sp
 232 
 233 .sp
 234 .TS
 235 box;
 236 c | c
 237 l | l .
 238 ATTRIBUTE TYPE  ATTRIBUTE VALUE
 239 _
 240 CSI     Enabled
 241 _
 242 Interface Stability     Committed
 243 _
 244 Standard        See \fBstandards\fR(5).
 245 .TE
 246 
 247 .SS "ksh93"
 248 .sp
 249 
 250 .sp
 251 .TS
 252 box;
 253 c | c
 254 l | l .
 255 ATTRIBUTE TYPE  ATTRIBUTE VALUE
 256 _
 257 Interface Stability     See below.
 258 .TE
 259 
 260 .sp
 261 .LP
 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
 265 .sp
 266 .LP
 267 \fBcat\fR(1), \fBksh93\fR(1), \fBattributes\fR(5), \fBenviron\fR(5),
 268 \fBlargefile\fR(5), \fBstandards\fR(5)