[ale] Password generating help needed

Alex Carver agcarver+ale at acarver.net
Fri Apr 17 14:49:23 EDT 2015


On 2015-04-17 11:30, Justin Goldberg wrote:
> I need a program or script that can generate a password that is 5 random
> letters followed by 5 random numbers. None of the tools out there that I've
> checked can do this.
> 
> Many thanks if anyone helps!

For a first attempt:

#!/bin/bash

parta=`pwgen -1 -0 5`
partb1=`od -vAn -N4 -tu4 < /dev/urandom`
partb2=$((partb1%=100000))

printf "% 5s%05d" $parta $partb2



More information about the Ale mailing list