#!/bin/sh

###
# This program is copyright Alec Muffett 1993. The author disclaims all
# responsibility or liability with respect to it's usage or its effect
# upon hardware or computer systems, and maintains copyright as set out
# in the "LICENCE" document which accompanies distributions of Crack v4.0
# and upwards.
###

# Modified as part of the krb5-strength project as follows:
#
# 2016-11-06  Russ Allbery <eagle@eyrie.org>
#   - Force C locale when sorting to avoid creating a corrupt dictionary.

### in case of explosion, invoke "sort" with "-T" option pointing to a lot
### of free space in a directory somewhere.

# Force C locale, since that's what packer expects.
LC_ALL=C; export LC_ALL

SORT="sort"
###SORT="sort -T /tmp"

cat $* |
	tr '[A-Z]' '[a-z]' |
	tr -cd '\012[a-z][0-9]' |
	$SORT |
	uniq |
	grep -v '^#' |
	grep -v '^$'
