c

csplit(1)

csplit(1)

original ®le; it is the user's responsibility to remove it when appropriate.

EXTERNAL INFLUENCES

Environment Variables

LC_COLLATE determines the collating sequence used in evaluating regular expressions.

LC_CTYPE determines the characters matched by character class expressions in regular expressions.

LC_MESSAGES determines the language in which messages are displayed.

If LC_COLLATE or LC_CTYPE or LC_MESSAGES is not speci®ed in the environment or is set to the empty string, the value of LANG is used as a default for each unspeci®ed or empty variable. If LANG is not speci®ed 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, csplit behaves as if all internationalization variables are set to "C". See environ(5).

International Code Set Support

Single- and multi-byte character code sets are supported.

DIAGNOSTICS

Messages are self explanatory except for:

arg - out of range

which means that the given argument did not reference a line between the current position and the end of the ®le. This warning also occurs if the ®le is exhausted before the repeat count is.

EXAMPLES

Create four ®les, cobol00 through cobol03. After editing the ``split'' ®les, recombine them back into the original ®le, destroying its previous contents.

csplit -f cobol file '/procedure division/' /par5./ /par16./

Perform editing operations

cat cobol0[0-3] > file

Split a ®le at every 100 lines, up to 10,000 lines (100 ®les). The -koption causes the created ®les to be retained if there are fewer than 10,000 lines (an error message is still printed).

csplit -k file 100 '{99}'

Assuming that prog.c follows the normal C coding convention of terminating routines with a } at the beginning of the line, create a ®le containing each separate C routine (up to 21) in prog.c.

csplit -k prog.c '%main(%' '/Ã}/+1' '{20}'

SEE ALSO

sh(1), split(1), environ(5), lang(5), regexp(5).

STANDARDS CONFORMANCE

csplit: SVID2, SVID3, XPG2, XPG3, XPG4

Section 1148

− 2 −

HP-UX Release 11i: December 2000