shell script named names are not repeated

The effect is as:

 

 code show as below:

. 1 ! # / Bin / the bash
 2  #Author: GaoHongYu
 . 3 # QQ: 1,061,767,621 
. 4 #Time: 2019 - 12 is - 24  22 is : 54 is : 36 
. 5  #Name: dm.sh
 . 6 #Version: Vl. 0 
. 7  
. 8 STU = ( Liu Chen and Zhangsanlisi Wang Wu Zhao 6th Sun seven weeks eight Wu nine Zheng ten)
 9  
10 MAX = $ {# STU [* ]}
 11  
12  the while :; do 
13      NUM = $ ((the RANDOM% MAX))
 14      IF [$ MAX $ {# stu_new -eq [* ]}]; the then
 15         echo " All students have points over the name of the " 
16          BREAK 
. 17      Fi
 18 is      name = $ {STU [$ NUM]}
 . 19      IF [   " $ {stu_new [$ NUM]} " ! = " $ {STU [$ NUM]} " ]; the then
 20 is           stu_new [$ NUM] = $ name
 21 is           Read -p " Enter to continue, press exit n-: " the Choose
 22 is      IF [ " $ the Choose " == ' n- ' ]; the then
 23 is          echo "Exit the program "
24         break
25     fi
26         echo -e "\t\t\t\t$name"
27     else
28         continue
29     fi
30 done

Guess you like

Origin www.cnblogs.com/gaohongyu/p/12105336.html