dotfiles/zsh/func/pw
2011-05-03 21:53:50 -07:00

12 lines
182 B
Bash

#!/bin/zsh
# vim:ft=zsh
pw ()
{
length='12'
if [[ $1 -ne "" ]]; then
length=$1
fi
tr -dc 'A-Za-z0-9!@#$%^&*' < /dev/urandom | fold -w $length | head -n 1
}