.TH paste "" "" Command
.PC "Merge lines of files"
\fBpaste [\-s] [\-d \fIlist\^\fB] \fIfile ...\fR
.PP
.HS
.SH Options:
.IC \fB\-s\fR
Display lines of input files sequentially across page
.IC "\fB\-d\fI list\fR"
Use \fIlist\fR as delimiters for output fields
.HE
.B paste
merges corresponding lines from multiple input files.
By default,
.B paste
uses the
.B <tab>
character to delineate texts from different files.
.B paste
writes the merged text to standard output;
thus,
.B paste
can be used at the head of a shell pipeline.
.PP
If
.B paste
reads EOF from any of the input files while other files still contain data,
it substitutes blank lines as input from the file that has ended.
.SH Options
.B paste
recognizes the following command-line options:
.IP "\fB\-d \fIlist\fR"
Use the characters in
.I list
to separate the output fields.
The characters in
.I list
are taken in sequence and used circularly,
i.e., taken in order until the end of
.I list
is reached, then returning to the first character in
.IR list .
By default,
.B paste
uses the
.B <tab>
character to delineate the output fields.
The following character sequences have special meaning when encountered in
.IR list :
.DS
\fB\e\e\fR	Output a single backslash character
\fB\et\fR	Output a \fB<tab>\fR character
\fB\en\fR	Output a \fB<newline>\fR character
\fB\e0\fR	Output a null string (i.e., no separator between output fields)
.DE
.IP \fB\-s\fR
Output successive lines from each input
.I file
across the page, with each input line separated from the next by a
.B <tab>
character.
After all input lines from a given file have been concatenated,
terminate the output line with a
.B <newline>
character and repeat the process on the next input file.
.SH Example
The following two files will be used for subsequent examples.
.B File1
contains:
.DM
.ta 0.5i
	File1_Line1
	File1_Line2
	File1_Line3
	File1_Line4
.DE
.PP
.B File2
contains:
.DM
.ta 0.5i
	File2_Line1
	File2_Line2
	File2_Line3
	File2_Line4
.DE
.PP
The command
.DM
.ta 0.5i
	paste File1 File2
.DE
.PP
generates the following output:
.DM
.ta 0.5i 1.75i
	File1_Line1	File2_Line1
	File1_Line2	File2_Line2
	File1_Line3	File2_Line3
	File1_Line4	File2_Line4
.DE
.PP
Adding the option
.B \-s
yields the output:
.DM
.ta 0.5i 1.75i 3.0i 4.25i
	File1_Line1	File1_Line2	File1_Line3	File1_Line4
	File2_Line1	File2_Line2	File2_Line3	File2_Line4
.DE
.SH "See Also"
.Xr "awk," awk
.Xr "commands," commands
.Xr "cut," cut
.Xr "sed" sed
.R
.SH Notes
.B paste
is copyright \(co 1989
by The Regents of the University of California.
All rights reserved.
