create a Random passwd

Hello Everyone,
I am wondering how to create a Random Password of 8 characters for a user. It has to be run in a script.
Also, The user have to be asked to change his/her password the first time they login.

I tried using genPass but seems like my system doesn't support that command.

For your info , I am a sort of new user.........

A prompt reply will be appreciated alot!

Thanks,
Ben

What OS are you using? It may help in giving a more 'correct' answer.

You can generate a password with any higher language...

A Perl script a co-worker wrote long ago has the following (grabs the name and adds random numbers to the end to create a password)
#!/u/bin/perl
...
... other code not shown...
...
# Pick a initial password.

$rvalue = int\(rand\(1000\)\);
\($uhead\) = \( $name[0] =~ /^\(.\{1,4\}\)/ \);
$nv = join\('',$uhead,$rvalue\);
$pwd = crypt\($nv,$SALT\);

...
...