PDA

View Full Version : bash random string



tapi0n
June 4th, 2011, 12:14 PM
I was wondering if it's possible to create an 8 char random string in bash. Non-capital and capital letters mixed. Found some info but they're all hashes of an existing string. I just want to generate a new string from [A-Za-z].

Cheers

kaibob
June 4th, 2011, 03:02 PM
I came across the following command-line a while back. It produces eight random upper- and lower-case letters.


tr -dc "[:alpha:]" < /dev/urandom | head -c 8