paste(1) DG/UX 5.4.2 paste(1)
NAME
paste - merge lines
SYNOPSIS
paste file1 file2 ...
paste -dlist file1 file2 ...
paste -s [-dlist] file1 file2 ...
where:
file1 The first input file
file2 The second input file
list One or more characters
DESCRIPTION
In the first two forms, paste concatenates corresponding lines of the
given input files file1, file2, etc. It treats each file as a column
or columns of a table and pastes them together horizontally (parallel
merging). It is the counterpart of cat(1), which concatenates
vertically, i.e., one file after the other. In its last form, paste
replaces the function of an older command with the same name by
combining subsequent lines of the input file (serial merging). In
all cases, lines are glued together with the tab character, or with
characters from an optionally specified list. Output is to the
standard output, so it can be used as the start of a pipe, or as a
filter, if - is used in place of a filename.
Options
-d Replace the default line concatenation character with the
characters specified in list. Without this option, the new-
line characters of each but the last file (or last line in
case of the -s option) are replaced by a tab character. The
list is used circularly; i.e., when exhausted, it is reused.
In parallel merging (i.e., no -s option), the lines from the
last file are always terminated with a new-line character, not
from the list. The list may contain the special escape
sequences: \n (new-line), \t (tab), \\ (backslash), and \0
(empty string, not a null character). You may need to enquote
characters if they 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.
The last character of the file is forced to be a new-line.
Use tab for concatenation, unless a list is specified with -d
option.
- May be used in place of any filename, to read a line from the
standard input (there is no prompting).
International Features
Paste can process characters from supplementary code sets as well as
ASCII characters.
With the -d option, characters from supplementary code sets can be
specified for list.
Licensed material--property of copyright holder(s) 1
paste(1) DG/UX 5.4.2 paste(1)
EXAMPLES
ls | paste -d" " - List directory in one column.
ls | paste - - - - List directory in four columns.
paste -s -d"\t\n" file Combine pairs of lines into lines.
DIAGNOSTICS
line too long Output lines are restricted to 511 characters.
too many files Except for the -s option, no more than 12 input
files may be specified.
SEE ALSO
cut(1), grep(1), pr(1).
Licensed material--property of copyright holder(s) 2