random password generator
April 23rd, 2009
I was searching in google how to generate random password and got two good easy to use methods.
First one is the most simplest one
uuidgen -r | cut -c-8 or uuidgen -t | cut -c-8
The -r option is for random based uuid generation with help of /dev/random and -t uses system clock plus ethernet address.
Second method is to call a function
function randompass {
pass= /dev/null 2>&1 || head -c 7)
echo $pass
}
now you can call this function in the shell script by just typing the name of the function “randompass”

