xref: /freebsd/usr.bin/fortune/tools/do_sort (revision 0957b409a90fd597c1e9124cbaf3edd2b488f4ac)
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