A simple Bash script to generate all possible permutations of characters from a given character set, in this case 0 to 9 and a to z (capital and lower-case sets):
charset=({a..z} {A..Z} {0..9});
permute(){
(($1 == 0)) && { echo "$2"; return; }
for char in "${charset[@]}"
do
permute "$((${1} - 1 ))" "$2$char"
done
}
permute "$1"
Usage: root@root:~# permute 2
Top comments (0)