home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 329_01 / paste.doc < prev    next >
Text File  |  1988-12-13  |  6KB  |  199 lines

  1.  
  2.  
  3.  
  4.      PASTE(1)                      UNIX 4.0                       PASTE(1)
  5.  
  6.  
  7.  
  8.      NAME
  9.           paste - merge same lines of several files or subsequent
  10.           lines of one file
  11.  
  12.      SYNOPSIS
  13.           paste file1 file2 ...
  14.           paste -dlist file1 file2 ...
  15.           paste -s [-d]list file1 file2 ...
  16.  
  17.      DESCRIPTION
  18.           In the first two forms, paste concatenates corresponding
  19.           lines of the given input files file1, file2, etc.  It treats
  20.           each file as a column or columns of a table and pastes them
  21.           together horizontally (parallel merging).  If you will, it
  22.           is the counterpart of cat(1) which concatenates vertically,
  23.           i.e., one file after the other. In the last form above,
  24.           paste replaces the function of an older command with the
  25.           same name by combining subsequent lines of the input file
  26.           (serial merging).  In all cases, lines are glued together
  27.           with the tab character, or with characters from an
  28.           optionally specified list.  Output is to the standard
  29.           output, so it can be used as the start of a pipe, or as a
  30.           filter, if - is used in place of a file name.
  31.  
  32.           The meanings of the options are:
  33.  
  34.           -d
  35.            Without this option, the new-line characters of each but
  36.            the last file (or last line in case of the -s option) are
  37.            replaced by a tab character.  This option allows replacing
  38.            the tab character by one or more alternate characters (see
  39.            below).
  40.  
  41.           list
  42.            One or more characters immediately following -d replace the
  43.            default tab as the line concatenation character.  The list
  44.            is used circularly, i.e., when exhausted, it is reused.  In
  45.            parallel merging (i.e., no -s option) the lines from the
  46.            last file are always terminated with a new-line character,
  47.            not from the list.  The list may contain the special escape
  48.            sequences: \n (new-line), \t (tab), \\ (backslash), and \0
  49.            (empty string, not a null character.)  Quoting may be
  50.            necessary, if characters have special meaning to the shell
  51.            (e.g., to get one backslash, use -_d"\\\\").  SPECIAL NOTE:
  52.            This version of paste has had the list of special
  53.            characters expanded from the Unix(Tm) standard to include
  54.            the following additional characters: \b (backspace), \f
  55.            (form-feed), \r (carriage return), \v (vertical tab).
  56.  
  57.           -s
  58.            Merge subsequent lines rather than one from each input
  59.            file.  Use tab for concatenation, unless a list is
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 8/19/84)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      PASTE(1)                      UNIX 4.0                       PASTE(1)
  71.  
  72.  
  73.  
  74.            specified with -d option.  Regardless of the list, the very
  75.            last character of the file is forced to be a new-line.
  76.  
  77.           -
  78.            May be used in place of any file name, to read a line from
  79.            the standard input. (There is no prompting).
  80.  
  81.      EXAMPLES
  82.           ls | paste -d
  83.             list directory in one column
  84.  
  85.           ls | paste - - - -
  86.             list directory in four columns
  87.  
  88.      SEE ALSO
  89.           grep(1),paste(1).
  90.  
  91.      DIAGNOSTICS
  92.           no delimiters
  93.             Missing list for -d option
  94.  
  95.           <filename> : cannot open
  96.             paste was given a bad filename
  97.  
  98.           too many files
  99.             Except for -s option, no more than 12 input files may be
  100.             specified.
  101.  
  102.      CAVEATS
  103.           This program is a complete rewrite of the Bell Laboratories
  104.           command of the same name; no part of the original source or
  105.           manual is included.  Therefore, you may feel free to use it,
  106.           and its source, without violation of any contract
  107.           agreements.  However, I retain the copyright in order to
  108.           specify it remain available for use by all and sundry,
  109.           without cost.  Feel free to modify as necessary, although I
  110.           went to great pains to recreate the behavior of the original
  111.           command; I would suggest this congruence be maintained.
  112.  
  113.           Along the same lines, although I've made a reasonable effort
  114.           to test the more arcane behavior of the original paste and
  115.           reproduce it, there are no guarantees; and there are four
  116.           known differences between the original program and
  117.           documentation, and this version.  All are downward
  118.           compatible.  First, paste as distributed with Unix has a bug
  119.           in the way it handles multiple files for the -s option.
  120.           This has been fixed, and the bug reported to the providers
  121.           of the Unix command.  Secondly, the list of valid escape
  122.           characters for the list has been expanded.  Third, the 511
  123.           character/line restriction has been removed.  Finally,
  124.           extant undocumented diagnostics have been added to the man
  125.           page, and the one pertaining to the (now obsolete) line too
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 8/19/84)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      PASTE(1)                      UNIX 4.0                       PASTE(1)
  137.  
  138.  
  139.  
  140.           long removed.
  141.  
  142.           I remain in no way liable for any loss, either explicit or
  143.           incidental, that may be incurred through use of this
  144.           command.  I do ask that any bugs (and, hopefully, fixes) be
  145.           reported back to me as encountered. - David M. Ihnat,
  146.           ihuxx!ignatz
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.      Page 3                                          (printed 8/19/84)
  196.  
  197.  
  198.  
  199.