gen_random_pw () { # Generate a random password if [ -c /dev/urandom ]; then # ...using /dev/urandom when possible tmp=$(dd if=/dev/urandom count=256 bs=1 2> /dev/null | md5sum | cut -b1-8) else # ...or something else if need be. # Last I was told, the Hurd had no /dev/urandom # (Correct me if it has changed) # Suggestions form something more random than $(date) are welcome tmp=$(date | md5sum | cut -b1-8) fi echo $tmp }