xref: /freebsd/usr.bin/fortune/tools/do_sort (revision 62cfcf62f627e5093fb37026a6d8c98e4d2ef04c)
1#! /bin/sh
2#
3#	@(#)do_sort	8.1 (Berkeley) 5/31/93
4# $FreeBSD$
5#
6# an aggressive little script for sorting the fortune files
7# depends on octal 02 and 03 not being anywhere in the files.
8
9sp="/usr/bin/sort -dfu -T /var/tmp"
10
11sed 's/^%$//' | tr '\12' '\3' | tr '\2' '\12' |
12	sed -e 's/^//' -e '/^$/d' -e 's/$/%/' |
13	$sp | tr '\3' '\12'
14