[root@localhost ~]# cat passwd.shbash
#!/bin/bashide
a=(a b c d e A B C D E F @ $ % ^ 0 1 2 3 4 5 6 7 8 9)spa
for ((i=0;i<20;i++));doorm
echo -n ${a[$RANDOM % ${#a[@]}]}it
doneclass
echodi
[root@localhost ~]# chmod +x passwd.sh view
[root@localhost ~]# sh passwd.sh vi
A3b72a%3EdCee310d1BDco