|HP-UX Reference > P
HP-UX 11i Version 3: February 2007
paste — merge same lines of several files or subsequent lines of one file
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 in a table and pastes them together horizontally (parallel merging). In other words, it is the horizontal counterpart of cat(1) which concatenates vertically; i.e., one file after the other. In the -s option form above, 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 standard output, so paste can be used as the start of a pipe, or as a filter if - is used instead of a file name.
paste recognizes the following options and command-line arguments:
LC_CTYPE determines the locale for the interpretation of text as single- and/or multi-byte characters.
LC_MESSAGES determines the language in which messages are displayed.
If LC_CTYPE or LC_MESSAGES is not specified in the environment or is set to the empty string, the value of LANG is used as a default for each unspecified or empty variable. If LANG is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of LANG.
If any internationalization variable contains an invalid setting, paste behaves as if all internationalization variables are set to "C". See environ(5).
These commands return the following values upon completion:
List directory in one column:
ls | paste -d" " -
List directory in four columns
ls | paste - - - -
Combine pairs of lines into lines
paste -s -d"\t\n" file