#!/bin/bash -e

# This preprocesses a set of word lists into a suitable form for input
# into cracklib-packer

# It probably requires GNU grep.

export LC_ALL=C
export LC_COLLATE=C

gzip -cdf "$@" |
    grep -av '^\(#\|$\)' |
    tr '[A-Z]' '[a-z]' |
    tr -cd '\012[a-z][0-9]' | sort -u |
    grep -E '^.{1,500}$' 
