# Key generator


# cat keygen
#!/bin/bash

length=$1
alphabet="$2"
function=""

for i in `seq $length`; do
        function+="for p$i in $alphabet; do "
done
function+="echo "
for i in `seq $length`; do
        function+="\$p$i"
done
for i in `seq 1 $length`; do
        function+="; done"
done

/bin/bash -c "set -o noglob;$function"
# ./keygen 3 "{a..z} {A..Z} {0..9}"
aaa
aab
aac
aad
aae
...
995
996
997
998
999

No comments: