.\" This file documents the GNU text utilities. .\" .\" Copyright (C) 1994, 95, 96 Free Software Foundation, Inc. .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of .\" this manual under the conditions for verbatim copying, provided that .\" the entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Permission is granted to copy and distribute translations of this .\" manual into another language, under the above conditions for modified .\" versions, except that this permission notice may be stated in a .\" translation approved by the Foundation. .\" .\" Japanese Version Copyright (c) 1997 NAKANO Takeo all rights reserved. .\" Translated Mon Jun 9 1997 by NAKANO Takeo .\" .TH CSPLIT 1 "GNU Text Utilities" "FSF" \" -*- nroff -*- .SH 名前 .\"O csplit \- split a file into sections determined by context lines csplit \- ファイルを文脈ベースで分割する .SH 書式 .B csplit [\-sqkz] [\-f prefix] [\-b suffix] [\-n digits] [\-\-prefix=prefix] [\-\-suffix\-format=suffix] [\-\-digits=digits] [\-\-quiet] [\-\-silent] [\-\-keep-files] [\-\-elide\-empty\-files] [\-\-help] [\-\-version] file pattern... .SH 説明 この文書はもうメンテナンスされていないので、不正確・不完全 な可能性がある。現在は texinfo 文書が正式な情報となっている。 .PP このマニュアルページは GNU 版 .BR csplit について記述したものである。 .B csplit は与えられた入力ファイル .IR file (ファイル名が `-' の場合は標準入力) の各セクション(section)の内容を持った 0 個以上の出力ファイルを作成す る。デフォルトでは .B csplit はそれぞれの出力ファイルを作成する際に、出力されたバイト数を表示する。 .PP 出力ファイルの内容は引き数 .I pattern によって定められる。 .\" An error occurs if a pattern argument refers to a .\" nonexistent line of the input file, such as if no remaining line .\" matches a given regular expression. After all the given patterns have .\" been matched, any remaining output is copied into one last output file. .I pattern 引き数で指定される行が入力ファイルに存在しない場合はエラーとなる。例え ば、与えられた正規表現にマッチする行が残っていない場合などが該当する。 ただし与えられた .I pattern が一度でもマッチしていれば、残りの出力は最後の出力ファイルにコピーされ る。 .I pattern 引き数の形式としては以下のようなものがある: .RS .TP .I line .br \fIline\fP には正の整数を指定する。出力ファイルを作成し、入力ファイル の内容を行番号が \fIline\fP になるまで書き込む(ただし \fIline\fP の 行は含まない)。この後にさらに数字が指定されると、次の出力ファイルが作 成され、入力ファイルの続きの内容をその行番号まで書き込んでいく。 .TP /\fIregexp\fP/[\fIoffset\fP] .br .\" Create an output file containing the current line up to (but not .\" including) the next line of the input file that contains a match for .\" \fIregexp\fP. The optional \fIoffset\fP is a `+' or `\-' followed by .\" a positive integer. If it is given, the input up to the matching line .\" plus or minus \fIoffset\fP is put into the output file, and the line .\" after that begins the next section of input. 出力ファイルを作成し、入力ファイルのうち .I regexp にマッチする行の前までの内容を書き込む(マッチ行は含まない)。 .I offset を付加することもできる。これは `+' または `-' に正の整数を続けて指定す る。 .I offset が指定されるとマッチ行に .I offset の値を加減した行までが出力される。 入力ファイルの残りは次のセクションの入力として利用される。 .TP %\fIregexp\fP%[\fIoffset\fP] .br .\" Like the previous type, except that it does not create an output file, .\" so that section of the input file is effectively ignored. 直前の形式と同様だが、出力ファイルが作成されない。したがって入力ファイルの 該当するセクションは無視されることになる。 .TP {\fIrepeat-count\fP} .br .\" Repeat the previous pattern \fIrepeat-count\fP (a positive integer) .\" additional times. An asterisk may be given in place of the (integer) .\" repeat count, in which case the preceeding pattern is repeated as .\" many times as necessary until the input is exausted. .I repeat-count には正の整数を指定する。 直前のパターンを .I repeat-count の回数だけ余計に繰りかえす。繰り返し回数の部分に整数でなくアスタリスク を指定することもできる。この場合は入力ファイルが終わるまで直前の パターンを繰り返す。 .RE .PP .\" The output file names consist of a prefix followed by a suffix. By .\" default, the suffix is merely an ascending linear sequence of two-digit .\" decimal numbers starting with 00 and ranging up to 99, however this .\" default may be overridden by either the .\" .I \-\-digits .\" option or by the .\" .I \-\-suffix\-format .\" option. (See below.) In any case, .\" concatenating the output files in sorted order by file name .\" produces the original input file, in order. The default output file .\" name prefix is `xx'. 出力ファイルのファイル名は二つの部分からなっている。デフォルトでは後半部 は 2 桁の 10 進数で、 00 から 99 まで順にカウントアップされて行く。 このデフォルトの設定は .I \-\-digits オプションや .I \-\-suffix\-format オプションによって変更できる(詳細は後述)。いずれの場合でも、出力ファ イルを名前でソートして順に結合させると、入力ファイルが得られるようになっ ている。前半部のデフォルト名は `xx' である。 .PP .\" By default, if .\" .B csplit .\" encounters an error or receives a hangup, interrupt, quit, or .\" terminate signal, it removes any output files that it has created so .\" far before it exits. .B csplit がエラーになったり、 hangup や interrupt、 quit、 terminate などのシグナルを 受け取った場合には、デフォルトではそれまでに作られた出力ファイルは消去される。 .SS オプション .TP .I "\-f, \-\-prefix=prefix" .I prefix を出力ファイル名の前半部分の文字列として用いる。 .TP .I "\-b, \-\-suffix\-format=suffix" .\" Use .\" .I suffix .\" as the output file name suffix string. When this option is specified, .\" the suffix string must include exactly one printf(3) style conversion .\" specification (such as %d, possibly including format .\" specification flags, a field width, a precision specifications, or all of .\" these kinds of modifiers). The conversion specification must be .\" suitable for converting a binary integer argument to readable form. .\" Thus, only `d', 'i', `u', `o', `x', and `X' format specifiers are allowed. .I suffix を出力ファイル名の後半部に用いる。 .I suffix には、 printf(3) 形式の変換文字列を指定しなければならない(例えば %d のようなもの。書式指定、文字列の幅、精度指定なども指定可能)。変換指定 文字列は整数を可読なかたちで出力するものでなければならない。したがって 使えるのは `d'、 `i'、 `u'、 `o'、 `x' および `X' に限られる。 .\" The entire suffix string is given .\" (with the current output file number) to sprintf(3) to form the file .\" name suffixes for each of the individual output files in turn. .I suffix 文字列はすべて(現在の出力ファイルが何番目かを示す数値と共に) sprintf(3) 関数に渡され、それぞれの出力ファイルに応じた名前が順番に出 力される。 .\" Note that when this option is used, the .\" .I \-\-digits .\" option is ignored. このオプションが指定された場合には、 .I \-\-digits オプションは無視されるので注意すること。 .TP .I "\-n, \-\-digits=digits" .\" Use output file names containing numbers that are .\" .I digits .\" digits long instead of the default 2. 出力ファイル名の数値部分の桁数をデフォルト値の 2 から .I digits に変更する。 .TP .I "\-k, \-\-keep-files" .\" Do not remove output files when errors are encountered. エラーが起こったときにそれまでに作成した出力ファイルを消去しないように する。 .TP .I "\-z, \-\-elide\-empty\-files" .\" Suppress the generation of zero-length output files. (In cases where .\" the section delimiters of the input file are supposed to mark the first .\" lines of each of the sections, the first output file will generally be a .\" zero-length file unless you use this option.) Note that the output file .\" sequence numbers will always run consecutively, starting from 0, .\" even in cases where zero-length output sections are suppressed due to the .\" use of this option. 大きさ 0 の出力ファイルを作らないようにする(セクションの区切りが入力 の最初の行にきた場合、このオプションを指定していなければ対応する出力ファ イルの大きさは 0 になる。なお出力ファイルの順番を示す番号は、このオプ ションによって大きさ 0 のファイルの出力が抑制された場合でも、常に 0 か らスタートする(そのような場合にはファイルの個数がひとつ少なくなること になる)。 .TP .I "\-s, \-q, \-\-silent, \-\-quiet" .\" Do not print counts of output file sizes. 出力ファイルのサイズを表示しない。 .TP .I "\-\-help" 使い方に関するメッセージを標準出力に表示し、実行成功を返して終了する。 .TP .I "\-\-version" バージョン情報を標準出力に表示して終了する。