Created
November 2, 2010 23:23
-
-
Save spikegrobstein/660506 to your computer and use it in GitHub Desktop.
random password generator for OSX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
## | |
# spit out random password. default length of 32 characters | |
# usage: | |
# ./random_pw <pw_length> | |
## | |
COUNT=$1 | |
DEFAULT_COUNT=32 | |
if [[ $1 = 0 || $1 -eq '' ]]; then | |
COUNT=$DEFAULT_COUNT | |
fi | |
head -c $COUNT /dev/random | uuencode -m - | tail -n 2 | head -n 1 | head -c $COUNT | |
echo "" # output newline |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment