minix/man/man1/paste.1
2012-03-31 23:47:03 +02:00

50 lines
1.4 KiB
Groff

.TH PASTE 1
.SH NAME
paste \- paste multiple files together
.SH SYNOPSIS
\fBpaste\fR [\fB\-s\fR]\fR [\fB\-d\fI list\fR] \fIfile...\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.TP 5
.B \-d
# Set delimiter used to separate columns to \fIlist\fR.
.TP 5
.B \-s
# Print files sequentially, file \fIk\fR on line \fIk\fR.
.SH EXAMPLES
.TP 20
.B paste file1 file2
# Print \fIfile1\fR in col 1, \fIfile2\fR in col 2
.TP 20
.B paste \-s f1 f2
# Print \fIf1\fR on line 1 and \fIf2\fR on line 2
.TP 20
.B paste -d : file1 file2
# Print the lines separated by a colon
.SH DESCRIPTION
.PP
\fIPaste\fR concatenates corresponding lines of the given input files
and writes them to standard output. The lines of the different files
are separated by the delimiters given with the option \-s\fR. If
no list is given, a tab is substituted for every linefeed, except the last one.
If end-of-file is hit on an input file, subsequent lines are empty.
Suppose a set of \fIk\fR files each has one word per line.
Then the \fIpaste\fR output will have \fIk\fR columns,
with the contents of file \fIj\fR in column \fIj\fR.
If the \fB\-s\fR flag is given, then the first
file is on line 1, the second file on line 2, etc.
In effect, \fB\-s\fR turns the output sideways.
.PP
If a list of delimiters is given, they are used in turn. The C escape
sequences \\n, \\t, \\\\, and \\0 are used for linefeed, tab, backslash, and
the null string, respectively.