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 .\" Portions Copyright 2021 OmniOS Community Edition (OmniOSce) Association.
  47 .\"
  48 .Dd Feb 9, 2021
  49 .Dt TEE 1
  50 .Os
  51 .Sh NAME
  52 .Nm tee
  53 .Nd replicate the standard output
  54 .Sh SYNOPSIS
  55 .Nm
  56 .Op Fl ail
  57 .Oo Ar file Oc Ns ...
  58 .Sh DESCRIPTION
  59 .Nm
  60 copies standard input to standard output, making a copy in zero or more files.
  61 .Nm
  62 does not buffer its output by default
  63 .Po but see the Fl l No option Pc .
  64 The options determine if the specified files are overwritten or appended to.
  65 If a write to a file fails,
  66 .Nm
  67 continues to write to other files although it exits with a non-zero
  68 exit status.
  69 .Ss ksh93
  70 The
  71 .Nm
  72 built-in in
  73 .Xr ksh93 1
  74 is associated with the
  75 .Pa /bin
  76 and
  77 .Pa /usr/bin
  78 paths.
  79 It is invoked when
  80 .Nm
  81 is executed without a pathname prefix and the pathname search finds a
  82 .Pa /bin/tee
  83 or
  84 .Pa /usr/bin/tee
  85 executable.
  86 .Sh OPTIONS
  87 The following options are supported:
  88 .Bl -tag -width Ar
  89 .It Fl a Ns \&, Fl \-append
  90 Appends the output to the files rather than overwriting them.
  91 .It Fl i Ns \&, Fl \-ignore-interrupts
  92 Ignores
  93 .Sy SIGINT
  94 signal.
  95 .It Fl l Ns \&, Fl \-linebuffer
  96 Sets the standard output to be line buffered.
  97 .El
  98 .Sh OPERANDS
  99 The following operands are supported:
 100 .Bl -tag -width Ar
 101 .It Ar file
 102 A path name of an output file.
 103 Processing of at least 13
 104 .Ar file
 105 operands is supported.
 106 .El
 107 .Sh EXIT STATUS
 108 .Bl -tag -width Ds
 109 .It Sy 0
 110 All files copied successfully.
 111 .It Sy >0
 112 An error occurred.
 113 .El
 114 .Sh ENVIRONMENT VARIABLES
 115 See
 116 .Xr environ 5
 117 for descriptions of the following environment variables
 118 that affect the execution of
 119 .Nm :
 120 .Ev LANG ,
 121 .Ev LC_ALL ,
 122 .Ev LC_TYPE ,
 123 .Ev LC_MESSAGES ,
 124 .Ev LC_NUMERIC ,
 125 and
 126 .Ev NLSPATH .
 127 .Sh INTERFACE STABILITY
 128 The command line interface of
 129 .Nm
 130 is
 131 .Sy Committed .
 132 The output of
 133 .Nm
 134 is
 135 .Sy Committed .
 136 The
 137 .Xr ksh93 1
 138 built-in binding to
 139 .Pa /bin
 140 and
 141 .Pa /usr/bin
 142 is
 143 .Sy Volatile .
 144 .Sh SEE ALSO
 145 .Xr cat 1 ,
 146 .Xr ksh93 1 ,
 147 .Xr attributes 5 ,
 148 .Xr environ 5 ,
 149 .Xr largefile 5 ,
 150 .Xr standards 5