summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2008-09-19 09:20:13 +0200
committerJim Meyering <meyering@redhat.com>2008-09-19 09:27:43 +0200
commitf923cecebafa22dd4d7e233e151b1202959fb12c (patch)
tree20a73409e7df984bef5bff24802d470f13aa7261 /doc
parente10e4b669715aa2ca8059987c9ae08b2a1ad7a14 (diff)
downloadcoreutils-f923cecebafa22dd4d7e233e151b1202959fb12c.tar.xz
doc: coreutils.texi (csplit invocation): Add an example.
Diffstat (limited to 'doc')
-rw-r--r--doc/coreutils.texi50
1 files changed, 50 insertions, 0 deletions
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index e4599e994..cd54d9199 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -3084,6 +3084,56 @@ Do not print counts of output file sizes.
@exitstatus
+Here is an example of its usage.
+First, create an empty directory for the exercise,
+and cd into it:
+
+@example
+$ mkdir d && cd d
+@end example
+
+Now, split the sequence of 1..14 on lines that end with 0 or 5:
+
+@example
+$ seq 14 | csplit - '/[05]$/' '@{*@}'
+8
+10
+15
+@end example
+
+Each number printed above is the size of an output
+file that csplit has just created.
+List the names of those output files:
+
+@example
+$ ls
+xx00 xx01 xx02
+@end example
+
+Use @command{head} to show their contents:
+
+@example
+$ head xx*
+==> xx00 <==
+1
+2
+3
+4
+
+==> xx01 <==
+5
+6
+7
+8
+9
+
+==> xx02 <==
+10
+11
+12
+13
+14
+@end example
@node Summarizing files
@chapter Summarizing files