Quantcast
Channel: User mwfearnley - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 37

Answer by mwfearnley for What is the mkdict command and what does it do? (It came in distro but has no man page or help)

$
0
0

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.


Viewing all articles
Browse latest Browse all 37

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>