summaryrefslogtreecommitdiff
path: root/games/fortune/tools/do_sort
blob: f6b51e6d67adee23ad57fa709c544a3642b03abf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#! /bin/sh
#	$OpenBSD: do_sort,v 1.2 2001/01/28 23:41:41 niklas Exp $
#	$NetBSD: do_sort,v 1.2 1995/03/23 08:28:54 cgd Exp $
#
#	@(#)do_sort	8.1 (Berkeley) 5/31/93
#
# 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/^%$//' | tr '\12' '\3' | tr '\2' '\12' | $sp | sed 'a\
	%' | sed -e 's/^//' -e 's/$//' | tr '\3' '\12'