MPE/iX Shell and Utilities Reference Manual, Vol 2

paste(1) MPE/iX Shell and Utilities paste(1)
NAME
paste — horizontally concatenate lines
SYNOPSIS
paste [–s][–d list] file ...
DESCRIPTION
paste concatenates lines of all the specified input files onto the standard output. If you spec-
ify (dash) instead of a file, paste uses the standard input. Normally, an output line con-
sists of the corresponding lines from all the input files. paste replaces the newline character
at the end of each input line (except the one from the last file on the command line) with a tab
character, or characters specified by the –d option.
Options
paste accepts the following options:
–d list specifies a list of characters to be used one at a time instead of the tab character to
replace the newline at the end of input lines. paste uses list circularly; when it
exhausts the characters in list, it returns to the first character in the list. If you also
specify the –s option, paste returns to the first character of list after processing
each file. Otherwise, it returns to the first character after each line of output. list may
contain any of the following standard
C escapes such as \n, \t, \r, \b, \\, and
\0, where \0 indicates that no separator is to be used.
–s concatenates all lines from each input file together on the single output line. If the –s
option is not specified and an end-of-file is detected on any (but not all) of the input
files, paste behaves as though empty lines have been read from those files.
EXAMPLES
The command
ls | paste –s –d’\t\t\n’
displays the output of ls in three tab separated columns.
If file A contains:
a
b
c
Commands and Utilities 1-405