2011/03/22

Random password in CLI

Just a small script so that we can generate passwords from the command line

NUMPASS=10
if [[ "$1" =~ ^[0-9]+$ ]] ; then
NUMPASS=$1
fi
echo "Spicy salt $(date)" | md5sum | sed "s/\(.\{$NUMPASS\}\).*/\1/"

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.