Open System Services Shell and Utilities Reference Manual (G06.27+, H06.04+)

paste(1) OSS Shell and Utilities Reference Manual
NAME
paste - Joins lines from one or more les
SYNOPSIS
paste [-d list][-s] le ...
The paste command reads input les, joins corresponding lines, and writes the result to stan-
dard output. It also reads standard input if you specify a - (dash) instead of a lename.
FLAGS
-d list Replaces the delimiter that separates lines in the output (tab by default) with one or
more characters from list.Iflist contains more than one character, then the characters
are repeated in order until the end of the output. In parallel merging, the lines from the
last le always end with a newline character instead of one from list.
The following special characters can be used in list:
\n Newline character
\t Tab
\\ Backslash
\0 Empty string (not a null character)
c An extended character
You must quote characters that have special meaning to the shell.
When the -s ag is specied with -d, the last newline character in a le is preserved,
and the delimiter is reset to the rst element of list after each le is processed. If -s is
not specied with -d, the newline characters in the last le specied are preserved, and
the delimiter is reset to the rst element of list each time a line is processed.
-s Merges all lines from each input le into one line of output (serial merging). With this
ag, paste works through one entire le before starting on the next. When it nishes
merging the lines in one le, it forces a newline and then merges the lines in the next
input le, continuing in the same way through the remaining input les, one at a time.
A tab separates the input lines unless you use the -d ag. Regardless of the list, the last
character of the output is a newline character.
DESCRIPTION
Without a ag, or with the -d ag, paste treats each le as a column and joins them horizontally
with a tab character by default (parallel merging).
With the -s ag, paste combines all lines of each input le into one output line (serial merging).
These lines are joined with the tab character by default.
Output lines can be of arbitrary length.
If an End-of-File condition is detected on one or more input les, but not all input les, paste
behaves as though empty lines were read from the le(s) on which End-of-File was detected,
unless the -s ag is specied.
Note that the output of pr -t -m is similar to that of paste, but it creates extra spaces, tabs, and
lines for an enhanced page layout.
74 Hewlett-Packard Company 527188-004