date and time created 91/11/21 13:36:30 by bostic
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 22 Nov 1991 05:36:30 +0000 (21:36 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 22 Nov 1991 05:36:30 +0000 (21:36 -0800)
SCCS-vsn: games/fortune/tools/do_sort 5.1

usr/src/games/fortune/tools/do_sort [new file with mode: 0644]

diff --git a/usr/src/games/fortune/tools/do_sort b/usr/src/games/fortune/tools/do_sort
new file mode 100644 (file)
index 0000000..fef0936
--- /dev/null
@@ -0,0 +1,11 @@
+#! /bin/sh
+#
+#      @(#)do_sort     5.1 (Berkeley) %G%
+#
+# an aggressive little script for sorting the fortune files
+# depends on octal 02 and 03 not being anywhere in the files.
+
+sp="/usr/bin/sort -bdfu -T /var/tmp"
+
+sed 's/^%$/\ 2/' | tr '\12' '\3' | tr '\2' '\12' | $sp | sed 'a\
+       %' | sed -e 's/^\ 3//' -e 's/\ 3$//' | tr '\3' '\12'