home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / GNUTUE.ZIP / man / csplit.man < prev    next >
Text File  |  1992-07-18  |  3KB  |  69 lines

  1. NAME
  2.      csplit - split a file into sections determined by context lines
  3.  
  4. SYNOPSIS
  5.      csplit [-sk] [-f prefix] [-n digits] [--prefix=prefix]  [--digits=digits]
  6.      [--quiet] [--silent] [--keep-files] file pattern...
  7.  
  8. DESCRIPTION
  9.      This manual page documents the GNU version  of  csplit.   csplit  creates
  10.      zero or more output files containing sections of the given input file, or
  11.      the standard input if the name `-' is given.  By default,  csplit  prints
  12.      the  number  of  bytes  written  to  each  output  file after it has been
  13.      created.
  14.  
  15.      The contents of the output files are determined by the pattern arguments.
  16.      An error occurs if a pattern argument refers to a nonexistent line of the
  17.      input file, such  as  if  no  remaining  line  matches  a  given  regular
  18.      expression.  The types of pattern arguments are:
  19.  
  20.      line
  21.           Create an output file containing the current line  up  to  (but  not
  22.           including)  line  line  (a  positive integer) of the input file.  If
  23.           followed by a repeat count, also create an  output  file  containing
  24.           the next line lines of the input file once for each repeat.
  25.  
  26.      /regexp/[offset]
  27.           Create an output file containing the current line  up  to  (but  not
  28.           including) the next line of the input file that contains a match for
  29.           regexp.  The optional offset is a `+' or `-' followed by a  positive
  30.           integer;  if  it  is given, the line that starts the next section of
  31.           the input file is the line that contains the match for  regexp  plus
  32.           the offset.
  33.  
  34.      %regexp%[offset]
  35.           Like the previous type, except that it does  not  create  an  output
  36.           file, so that section of the input file is effectively ignored.
  37.  
  38.      {repeat-count}
  39.           Repeat  the  previous  pattern  repeat-count  (a  positive  integer)
  40.           additional times.
  41.  
  42.      The output file names consist of a prefix followed by a number,  so  that
  43.      concatenating  the output files in sorted order by file name produces the
  44.      original input file, in order.  The default output file  name  prefix  is
  45.      `xx'.
  46.  
  47.      By  default,  if  csplit  encounters  an  error  or  receives  a  hangup,
  48.      interrupt, quit, or terminate signal, it removes any output files that it
  49.      has created so far before it exits.
  50.  
  51.      OPTIONS
  52.  
  53.      -f, --prefix=prefix
  54.           Use prefix as the output file name prefix.
  55.  
  56.      -k, --keep-files
  57.           Do not remove output files.
  58.  
  59.      -n, --digits=digits
  60.           Use output file names containing numbers that are digits digits long
  61.           instead of the default 2.
  62.  
  63.      -s, --silent, --quiet
  64.           Do not print counts of output file sizes.
  65.  
  66.      The long-named options can be introduced with `+' as well  as  `--',  for
  67.      compatibility with previous releases.  Eventually support for `+' will be
  68.      removed, because it is incompatible with the POSIX.2 standard.
  69.