On my system, /usr/sbin/mkdict
is a symlink for cracklib-format
, which as pointed out in comments, is a simple shell script. It's short enough to post here.
#!/bin/sh## This preprocesses a set of word lists into a suitable form for input# into cracklib-packer#LC_ALL=Cexport LC_ALLgzip -cdf "$@" | # concatenate input files, gunzipping if necessary grep -v '^\(#\|$\)' | # Remove lines that are blank or begin with '#' tr '[:upper:]''[:lower:]' | # transform all letters to lower case tr -cd '\n[:graph:]' | # strip everything except newlines and printable characters sort -u # sort alphabetically, remove duplicates
I've added comments to the script.Essentially it just takes a set of (possibly gzip'd) word list files, and outputs a sorted list of lower-case words.
Note: there is a more recent version of the script that can be seen in Github.