#!/bin/bash

a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"

pass=""

for i in {1..6}

do

 sum=$[RANDOM%${#a}]

 y=${a:$sum:1} 

 pass=$pass$y

done

echo $pass


##############################################################


#!/bin/bash

AA=(0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z)

read -p "please input one number: " EE

for ((j=1;j<=EE;++j ))

do

  PASS=""

  for ((i=1;i<=6;++i ))

  do

    BB=$(($RANDOM%32))

    CC=${AA[$BB]}

    PASS+=$CC

  done

  echo $PASS

done