csplit.1
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 1 代码 · 共 177 行
1
177 行
.TH csplit 1.SH Namecsplit \- context split.SH Syntax.B csplit[ \fB\-s\fR ] [ \fB\-k\fR ] [ \fB\-f \fIprefix\fR ]\fIfile\fR \fIarg1\fR [ \fI...argn\fR ].SH Description.NXR "csplit command"The.PN csplitcommand reads.I fileand separates it into n+1 sections, asdefined by the arguments.I arg1...argn.By default, the sections are placed inxx00...xxn(\fIn\fR may not be greater than 99).The named.I fileis sectioned in the following way:.TP 600:From the start of.I fileup to (but not including) the line referenced by.I arg1..TP 601:From the line referenced by.I arg1up to the line referenced by.I arg2..RS 6.B ".".br.B ".".br.B ".".RE.TP 6n:From the line referenced by.I argnto the end of.I file..RE.PPIf the.I fileargument is a minus (\-)then standard input is used. A minus is an ASCII octal 055..PP.SH Options.TP 20.B \-sSuppresses the printing of all character counts. If the .B \-soption is omitted, the.PN csplitcommand prints the character counts for each file created..TP.B \-kLeaves previously created files intact. If the .B \-koption is omitted, .PN csplitautomatically removes created files if an error occurs..TP.BI \-f prefixNames the created files.I prefix00...prefixn.The default is \fIxx00...xxn\fR..RE.PPThe arguments(\fIarg1...argn\fR)to.PN csplitcan be a combination of the following:.RS 6.TP 20/\fIrexp\fR/[\fIoffset\fR]A file is created for the section from the current lineup to (but not including) the line containing the regular expression.IR rexp .The current line becomes the line containing.IR rexp .The optional \fIoffset\fR is plus (+) or minus (\-) the number of lines.For example, /Page/\-5..TP 20%\fIrexp\fR%[\fIoffset\fR]This argument is the same as/\fIrexp\fR/[\fIoffset\fR],except that no file is created for the section..TP 20.I lnnoA file is created from the current line up to (but not including).IR lnno.The current line becomes.IR lnno..TP 20.RI { num }Repeat argument.This argument may follow any of the above arguments.If it follows a.I rexpargument, that argument is applied.I nummore times.If it follows.IR lnno,the file will be split every.I lnnolines.RI ( numtimes)from that point..RE.PPEnclose all.I rexptype arguments that contain blanks or other characters meaningful tothe Shell in the appropriate quotes.Regular expressions should not contain embedded new-lines.The.PN csplitcommand does not affect the original file;it is the user's responsibility to remove it..SH Examples.EX 0csplit \-f cobol file /procedure division/ /par5./ /par16./.EEThis example creates four files, cobol00...cobol03.After editing the files that.PN csplitcreated, they can be recombined as follows:.EXcat cobol0[0\-3] > file.EENote that this example overwrites the original file..sp.EX csplit \-k file\ \ 100\ \ {99}.EEThis example splits the file every 100 lines, up to10,000 lines.The.B \-koption causes the created files to be retained if thereare less than 10,000 lines; however, an error message wouldstill be printed..sp.EXcsplit \-k prog.c\ \ \(fm%main(%\(fm\ \ \(fm/^}/+1\(fm\ \ {20}.EEAssuming that.PN prog.cfollows the normal C coding convention ofending routines with a right brace(\fB}\fR)at the beginning of the line,this example creates a file containing each separateC routine (up to 21) in.PN prog.c ..SH DiagnosticsThe diagnostics are self explanatory except for the following:.EXarg \- out of range.EEThis message means that the given argument did not reference a linebetween the current position and the end of the file..SH See Alsoed(1), sh(1)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?