2 .\" Copyright 1989 AT&T Copyright (c) 1992, X/Open Company Limited All Rights Reserved Portions Copyright (c) 1996, Sun Microsystems, Inc. All Rights Reserved
3 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
4 .\" http://www.opengroup.org/bookstore/.
5 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
6 .\" This notice shall appear on any product containing this material.
7 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
9 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
10 .TH PASTE 1 "Dec 20, 1996"
12 paste \- merge corresponding or subsequent lines of files
16 \fBpaste\fR [\fB-s\fR] [\fB-d\fR \fIlist\fR] \fIfile\fR...
22 The \fBpaste\fR utility will concatenate the corresponding lines of the given
23 input files, and write the resulting lines to standard output.
26 The default operation of \fBpaste\fR will concatenate the corresponding lines
27 of the input files. The \fBNEWLINE\fR character of every line except the line
28 from the last input file will be replaced with a \fBTAB\fR character.
31 If an \fBEOF\fR (end-of-file) condition is detected on one or more input files,
32 but not all input files, \fBpaste\fR will behave as though empty lines were
33 read from the files on which \fBEOF\fR was detected, unless the \fB-s\fR option
38 The following options are supported:
42 \fB\fB-d\fR \fIlist\fR \fR
45 Unless a backslash character (\|\e\|) appears in \fIlist\fR, each character in
46 \fIlist\fR is an element specifying a delimiter character. If a backslash
47 character appears in \fIlist\fR, the backslash character and one or more
48 characters following it are an element specifying a delimiter character as
49 described below. These elements specify one or more delimiters to use, instead
50 of the default \fBTAB\fR character, to replace the \fBNEWLINE\fR character of
51 the input lines. The elements in \fIlist\fR are used circularly. That is, when
52 the list is exhausted, the first element from the list is reused.
54 When the \fB-s\fR option is specified:
59 The last newline character in a file will not be modified.
65 The delimiter will be reset to the first element of list after each \fIfile\fR
68 When the option is not specified:
73 The \fBNEWLINE\fR characters in the file specified by the last \fIfile\fR will
80 The delimiter will be reset to the first element of \fIlist\fR each time a line
81 is processed from each file.
83 If a backslash character appears in \fIlist\fR, it and the character following
84 it will be used to represent the following delimiter characters:
118 Empty string (not a null character). If \fB\e0\fR is immediately followed by
119 the character \fBx\fR, the character \fBX\fR, or any character defined by the
120 \fBLC_CTYPE\fR \fBdigit\fR keyword, the results are unspecified.
123 If any other characters follow the backslash, the results are unspecified.
132 Concatenate all of the lines of each separate input file in command line order.
133 The \fBNEWLINE\fR character of every line except the last line in each input
134 file will be replaced with the \fBTAB\fR character, unless otherwise specified
135 by the \fB-d\fR option.
141 The following operand is supported:
148 A path name of an input file. If \fB\(mi\fR is specified for one or more of the
149 \fIfile\fRs, the standard input will be used. The standard input will be read
150 one line at a time, circularly, for each instance of \fB\(mi\fR\&.
151 Implementations support pasting of at least 12 \fIfile\fR operands.
157 See \fBlargefile\fR(5) for the description of the behavior of \fBpaste\fR when
158 encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
161 \fBExample 1 \fRListing a directory in one column
165 example% \fBls | paste -d" " \(mi\fR
171 \fBExample 2 \fRListing a directory in four columns
175 example% \fBls | paste \(mi \(mi \(mi \(mi\fR
181 \fBExample 3 \fRCombining pairs of lines from a file into single lines
185 example% \fBpaste -s -d"\e t\e n" file\fR
190 .SH ENVIRONMENT VARIABLES
193 See \fBenviron\fR(5) for descriptions of the following environment variables
194 that affect the execution of \fBpaste\fR: \fBLANG\fR, \fBLC_ALL\fR,
195 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
199 The following exit values are returned:
206 Successful completion.
221 See \fBattributes\fR(5) for descriptions of the following attributes:
229 ATTRIBUTE TYPE ATTRIBUTE VALUE
233 Interface Stability Standard
239 \fBcut\fR(1), \fBgrep\fR(1), \fBpr\fR(1), \fBattributes\fR(5),
240 \fBenviron\fR(5), \fBlargefile\fR(5), \fBstandards\fR(5)
245 \fB\fB"line too long"\fR\fR
248 Output lines are restricted to 511 characters.
254 \fB\fB"too many files"\fR\fR
257 Except for \fB-s\fR option, no more than 12 input files may be specified.
263 \fB\fB"no delimiters"\fR\fR
266 The \fB-d\fR option was specified with an empty list.
272 \fB\fB"cannot open \fR\fBfile\fR\fB"\fR\fR
275 The specified file cannot be opened.