summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-01-01 21:56:21 +0000
committerJim Meyering <jim@meyering.net>1999-01-01 21:56:21 +0000
commitc704267b2610f5fb60c32b20a523cad13e9386a8 (patch)
tree88b78f5500b842623a0e86d82af9cbdeccaa2f4e /doc
parent3972420f3b82033be9205db19aeea588df80056f (diff)
downloadcoreutils-c704267b2610f5fb60c32b20a523cad13e9386a8.tar.xz
*** empty log message ***
Diffstat (limited to 'doc')
-rw-r--r--doc/textutils.texi10
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/textutils.texi b/doc/textutils.texi
index a0e23847a..c30bc749f 100644
--- a/doc/textutils.texi
+++ b/doc/textutils.texi
@@ -2183,6 +2183,16 @@ and an explicit @samp{n} with the second key specifier.
sort -t : -b -k 5,5 -k 3,3n /etc/passwd
@end example
+@c This example is a bit contrived and needs more explanation.
+@c @item
+@c Sort records separated by an arbitrary string by using a pipe to convert
+@c each record delimiter string to @samp{\0}, then using sort's -z option,
+@c and converting each @samp{\0} back to the original record delimiter.
+@c
+@c @example
+@c printf 'c\n\nb\n\na\n'|perl -0pe 's/\n\n/\n\0/g'|sort -z|perl -0pe 's/\0/\n/g'
+@c @end example
+
@end itemize