Quote:
Originally Posted by
Corona688
What does it mean to split a file, to stdout? They'd all end up in the same place, so hardly splitting...
All the manpage I have says about stdout is that it'll print byte counts to it. Nothing about not creating files.
Let me rephrase.
"bigfile" is actually not a file, it's a stream of bytes from the network.
What splitting to stdout means is that splitting does not require 2X the file size, i.e. bigfile + all the split segments, if one wants to do some processing on the split segments before saving them as "bigfile" locally (the processing being done using shell utilities that, unlike getchar in C, cannot recognise EOF).
Here's what one manpage says on the arguments to csplit:
<code>
The args operands may be a combination of the following patterns:
/regexp/[[+|-]offset]
Create a file containing the input from the current line to (but not including) the next line matching the given basic regular expression. An optional offset from the line that matched may be specified.
%regexp%[[+|-]offset]
Same as above but a file is not created for the output.
line_no
Create containing the input from the current line to (but not including) the specified line number.
{num}
Repeat the previous pattern the specified number of times. If it follows a line number pattern, a new file will be created for each line_no lines, num times. The first line of the file is line number 1 for historic reasons.
</code>
I think I misinterpreted the existence of arg with the % delimiter to imply the segments could be printed to stdout, without creating files. Reading the manpage again, I think that arg is only for excluding some segments from being saved. And I'm not sure printing the segments to stdout would make any difference, i.e., shell utilities still could not detect the EOF. But, I was curious.