'\" te .\" Copyright 1989 AT&T .\" Copyright (c) 1992, X/Open Company Limited All Rights Reserved .\" Portions Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. .\" Portions Copyright (c) 1982-2007 AT&T Knowledge Ventures .\" 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 http://www.opengroup.org/bookstore/. .\" 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. This notice shall appear on any product containing this material. .TH paste 1 "28 Nov 2011" "SunOS 5.11" "User Commands" .SH NAME paste \- merge corresponding or subsequent lines of files .SH SYNOPSIS .LP .nf \fB/usr/bin/paste\fR [\fIoptions\fR] [\fIfile\fR...] .fi .SH DESCRIPTION .sp .LP The paste utility concatenates the corresponding lines of the given input files, and write the resulting lines to standard output. .sp .LP The default operation of paste concatenates the corresponding lines of the input files. The NEWLINE character of every line except the line from the last input file is replaced with a TAB character. .sp .LP If an EOF (end-of-file) condition is detected on one or more input files, but not all input files, paste behaves as though empty lines were read from the files on which EOF was detected, unless the \fB-s\fR option is specified. .SH OPTIONS .sp .LP The following options are supported: .sp .ne 2 .mk .na \fB\fB-d\fR \fIlist\fR\fR .ad .RS 11n .rt Unless a backslash character (\fB\e\fR) appears in list, each character in list is an element specifying a delimiter character. If a backslash character appears in list, the backslash character and one or more characters following it are an element specifying a delimiter character as described below. These elements specify one or more delimiters to use, instead of the default TAB character, to replace the NEWLINE character of the input lines. The elements in list are used circularly. That is, when the list is exhausted, the first element from the list is reused. .sp When the \fB-s\fR option is specified: .RS +4 .TP .ie t \(bu .el o The last NEWLINE character in a file is not modified. .RE .RS +4 .TP .ie t \(bu .el o The delimiter is reset to the first element of list after each file operand is processed. .RE When the option is not specified: .RS +4 .TP .ie t \(bu .el o The NEWLINE characters in the file specified by the last file is not modified. .RE .RS +4 .TP .ie t \(bu .el o The delimiter is reset to the first element of list each time a line is processed from each file. .RE If a backslash character appears in list, it and the character following it is used to represent the following delimiter characters: .sp .ne 2 .mk .na \fB\fB\en\fR\fR .ad .RS 8n .rt NEWLINE character. .RE .sp .ne 2 .mk .na \fB\fB\et\fR\fR .ad .RS 8n .rt TAB character. .RE .sp .ne 2 .mk .na \fB\fB\e\e\fR\fR .ad .RS 8n .rt Backslash character. .RE .sp .ne 2 .mk .na \fB\fB\e0\fR\fR .ad .RS 8n .rt Empty string (not a null character). If \fB0\fR is immediately followed by the character \fBx\fR, the character \fBX\fR, or any character defined by the \fBLC_CTYPE\fR digit keyword, the results are unspecified. .RE If any other characters follow the backslash, the results are unspecified. .RE .sp .ne 2 .mk .na \fB\fB-s\fR\fR .ad .RS 11n .rt Concatenate all of the lines of each separate input file in command line order. The NEWLINE character of every line except the last line in each input file is replaced with the TAB character, unless otherwise specified by the \fB-d\fR option. .RE .SH OPERANDS .sp .LP The following operand is supported: .sp .ne 2 .mk .na \fB\fIfile\fR\fR .ad .RS 8n .rt A path name of an input file. If is specified for one or more of the files, the standard input is used. The standard input is read one line at a time, circularly, for each instance of dot \fB\&.\fR. Implementations support pasting of at least 12 file operands. .RE .SH USAGE .sp .LP See \fBlargefile\fR(5) for the description of the behavior of \fBpaste\fR when encountering files greater than or equal to 2 Gbyte (2^31 bytes). .SH EXAMPLES .LP \fBExample 1 \fRListing a Directory in One Column .sp .LP The following example lists a directory in one column: .sp .in +2 .nf example% \fBls | paste -d" " \(mi\fR .fi .in -2 .sp .LP \fBExample 2 \fRListing a Directory in Four Columns .sp .LP The following example lists a directory in four columns: .sp .in +2 .nf example% \fBls | paste \(mi \(mi \(mi \(mi\fR .fi .in -2 .sp .LP \fBExample 3 \fRCombining Pairs of Lines from a File into Single Lines .sp .LP The following example combines pairs of lines from a file into single lines: .sp .in +2 .nf example% \fBpaste -s -d"\e t\e n" file\fR .fi .in -2 .sp .SH ENVIRONMENT VARIABLES .sp .LP See \fBenviron\fR(5) for descriptions of the following environment variables that affect the execution of \fBpaste\fR: \fBLANG\fR, \fBLC_ALL\fR, \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR. .SH EXIT STATUS .sp .LP The following exit values are returned: .sp .ne 2 .mk .na \fB\fB0\fR\fR .ad .RS 6n .rt Successful completion. .RE .sp .ne 2 .mk .na \fB\fB>0\fR\fR .ad .RS 6n .rt An error occurred. .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Availabilitysystem/core-os _ CSIEnabled _ Interface StabilityCommitted _ StandardSee \fBstandards\fR(5). .TE .SH SEE ALSO .sp .LP \fBcut\fR(1), \fBgrep\fR(1), , \fBattributes\fR(5), \fBenviron\fR(5), \fBlargefile\fR(5), \fBstandards\fR(5)