paste [-s] [-d list] file file [ - ]...
Concatenate the corresponding lines of the files (one from each)
replacing newline characters with a single delimter (except the last file's ).
If the end of a file is reached while other files still
contain data, empty lines are supplied.
To use STDIN specify
|Serially concatenate all lines of each file before
proceding to the next file (in command line order). |
The newlines are replaced with the delimiter (except the last line) .
| of delimiter characters to replace the
The characters in list are used circularly,
i.e., after the last character in list is used, the first character is used.
This continues until a line from the last input file
operation) or the last line in each file (
is processed, then characters are selected from the beginning of list again.
The default delimeter is
\0 No delimiter is inserted (not a null character)
- as one of the files
; standard input is read one line at a time, circularly, for each instance of
> cat f0
> cat f1
> paste -d , f0 f1
> paste -s f0 f1
01 [tab] 02 [tab] 03
11 [tab] 12 [tab] 13
> paste -d "\0" f0 f1
> paste -d "\'" f0 f1
Combine pairs of lines from a file into single lines:
paste -s -d '\t\n' myfile
Number the lines in a file, similar to nl(1):
sed = myfile | paste -s -d '\t\n' - -
Create a colon-separated list of directories named bin, suitable for use
in the PATH environment variable:
find / -name bin -type d | paste -s -d : -
See cut, lam
BSD June 25, 2004