dotfiles/zsh/func/pw

13 lines
182 B
Text
Raw Normal View History

2011-05-03 21:53:50 -07:00
#!/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
}