Jan 15
2014
Linux random password
in bash script
tr -dc A-Za-z0-9_ < /dev/urandom | head -c 16 | xargs
function in $HOME/.bashrc
genpasswd() {
local l=$1
[ "$l" == "" ] && l=16
tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${l} | xargs
}