[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Password generating help needed
- Subject: [ale] Password generating help needed
- From: agcarver+ale at acarver.net (Alex Carver)
- Date: Fri, 17 Apr 2015 11:49:23 -0700
- In-reply-to: <CAAU2Bpbe+w1XmeL2oH=VUUiowzc6=ZGsWMqMtpz8j3yfTGdp+A@mail.gmail.com>
- References: <CAAU2Bpbe+w1XmeL2oH=VUUiowzc6=ZGsWMqMtpz8j3yfTGdp+A@mail.gmail.com>
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