PASTE(1) DOMAIN/IX SYS5 PASTE(1)
NAME
paste - merge same lines of several files or subsequent
lines of one file
USAGE
paste [-ds] [list] file1 file2 ...
DESCRIPTION
If you specify no options, or simply the -d option, paste
concatenates corresponding lines of the given input files (
file1, file2, etc. ). It treats each file as one or more
columns of a table and pastes them together horizontally
(also known as parallel merging). You may specify a dash
(-) in place of a filename, causing paste to read from the
standard input (note that there is no prompting for this).
Paste is the counterpart of cat(1), which concatenates vert-
ically (i.e., one file after the other).
If you specify the -s option, paste replaces the function of
an older command with the same name by combining subsequent
lines of the input file (also known as serial merging). In
all cases, lines are glued together with the tab character,
or with characters from an optionally specified list. Out-
put is to the standard output, so it can be used as the
start of a pipe, or as a filter, if a dash is used in place
of a filename.
OPTIONS
-d Do not replace the newline characters of each but
the last file (or last line) by a tab character.
Allow replacement of the tab character by one or
more alternate characters (see below).
list Replace the default tab as the line concatenation
character with the one or more characters immedi-
ately following -d. When the list is exhausted, it
is reused. In parallel merging (i.e., no -s
option), the lines from the last file are always
terminated with a newline character, not from the
list. The list may contain these special escape
sequences: \n (newline), \t (tab), \(backslash),
and \0 (empty string, not a null character). Quo-
tation marks may be necessary, if characters have
special meaning to the Shell (e.g., to get one
backslash, use -d``\'').
-s Merge subsequent lines rather than one from each
input file. Use tab for concatenation, unless a
list is specified with the -d option. Regardless
Printed 12/4/86 PASTE-1
PASTE(1) DOMAIN/IX SYS5 PASTE(1)
of the list, the very last character of the file
is forced to be a newline.
EXAMPLES
To list the current directory in three columns, use the fol-
lowing command:
ls | paste - - -
To combine pairs of lines into lines in file, use this com-
mand:
paste -s -d"\t\n" file
DIAGNOSTICS
``line too long'' Output lines are restricted to 511 char-
acters.
``too many files'' Except for the -s option, no more than
12 input files may be specified.
RELATED INFORMATION
cut(1), grep(1), pr(1).
PASTE-2 Printed 12/4/86