


PASTE(1V)                USER COMMANDS                  PASTE(1V)



NAME
     paste - join corresponding lines of several files, or subse-
     quent lines of one file

SYNOPSIS
     paste _f_i_l_e_n_a_m_e_1 _f_i_l_e_n_a_m_e_2 ...
     paste -d_l_i_s_t _f_i_l_e_n_a_m_e_1 _f_i_l_e_n_a_m_e_2 ...
     paste -s [ -d_l_i_s_t ] _f_i_l_e_n_a_m_e

AVAILABILITY
     This command is available with the _S_y_s_t_e_m _V software instal-
     lation  option.   Refer to _I_n_s_t_a_l_l_i_n_g _S_u_n_O_S _4._1 for informa-
     tion on how to install optional software.

DESCRIPTION
     In the first two  forms,  paste  concatenates  corresponding
     lines  of  the  given input files _f_i_l_e_n_a_m_e_1, _f_i_l_e_n_a_m_e_2, 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(1V)  which  concatenates  vertically,
     that  is, one file after the other.  In the last 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 option-
     ally specified _l_i_s_t.  paste can be used as a filter, if - is
     used in place of a filename.

OPTIONS
     -d   Without this option, the NEWLINE characters of each but
          the  last  file (or last line in case of the -s option)
          are replaced by a TAB character.   This  option  allows
          replacing  the  TAB  character by one or more alternate
          characters in _l_i_s_t. The list is used  circularly;  when
          exhausted,  it  is  reused.  In parallel merging (no -s
          option), the lines from the last file are  always  ter-
          minated  with  a  NEWLINE character, not from the _l_i_s_t.
          _l_i_s_t may contain the special escape sequences: \n (NEW-
          LINE),  \t (tab), \\ (backslash), and \0 (empty string,
          not a null character).  Quoting may  be  necessary,  if
          characters have special meaning to the shell.

     -s   Merge subsequent lines rather than one from each  input
          file.  Use TAB for concatenation, unless _l_i_s_t is speci-
          fied with -d.  Regardless of the _l_i_s_t,  the  very  last
          character of the file is forced to be a NEWLINE.

EXAMPLES
     List directory in four columns:

          ls | paste----




Sun Release 4.1  Last change: 17 September 1989                 1






PASTE(1V)                USER COMMANDS                  PASTE(1V)



     Combine pairs of lines into lines:

          paste -s -d"\t\n" filename

SEE ALSO
     cat(1V), cut(1V), grep(1V), pr(1V)

DIAGNOSTICS
     line too long
          Output lines are restricted to 511 characters.

     too many files
          Except for -s option, no more than 12 input  files  may
          be specified.









































Sun Release 4.1  Last change: 17 September 1989                 2



