PASTE(1V) — UNIX Programmer’s Manual
NAME
paste − merge corresponding lines of several files, or subsequent lines of one file.
SYNOPSIS
/usr/5bin/paste file ...
/usr/5bin/paste −dlist file ...
/usr/5bin/paste −s [ −dlist ] file ...
DESCRIPTION
In the first two forms shown above, paste concatenates corresponding lines from the input files, and writes the result on its standard output. It can be regarded as a sideways counterpart of cat. In the third form, paste concatenates subsequent lines from the input file, again in a sideways fashion.
Paste uses a TAB character to join the lines together, unless the −d option is specified.
A hyphen (‘−’) may be used in place of one or more of the input filenames to represent standard input.
OPTIONS
−dlist Specifies a list of characters to use a separators in place of TAB. The following escape sequences are recognised: \n (newline), \t (tab), \\ (backslash) and \0 (the empty string). Remember to quote these characters if your shell places special interpretation upon them. The list is consumed in a circular manner; each time a separator is needed the next is taken from the list, starting again at the beginning when it is exhausted. When using the first two forms of the command, the final separator (at the end of the output line) is always forced to be a newline, and is not taken from the list.
−s Concatenate subsequent lines rather than one from each input file. May be used in conjunction with the −d option; otherwise the TAB character will be used as the separator. The output file is always newline-terminated.
EXAMPLES
Combine each group of three lines into one long line:
paste -s −d"\t\t\n" file
Display the output of who(1) in two columns:
who | paste − −
SEE ALSO
BUGS
Output lines may not exceed 511 characters. A maximum of 12 input files may be used (does not apply to the −s option).
4th Berkeley Distribution