I need to generate many random alphanumeric strings, which also use capital letters. It needs to start with 3 characters (e.g. Dk6) and then, with a while loop, go up to about 9 characters (e.g. D7H3j8Sjx). Also, I'm using sshpass and I need to check when it's the correct password, then stop. I know that to guess the password, it would take a very long time, but it would also help if it guessed it by going aaa, aab, aac, aad... aaz, aa1 etc.
41 Answer
This function
function letter() { s=abcdefghijklmnopqrstuvxwyz p=$(( $RANDOM % 26)) echo -n ${s:$p:1} }generates a random letter. You can substitute abc... for the list of characters you wish to use, count them, and substitute their number to the 26 in line 3.
4