! # / bin / bash for i in `seq 1 10` do IF the above mentioned id user- $ i> / dev / null; the then the Read -ep" user- $ i user already exists, whether to remove (the y-/ the n-) "SS IF [= SS $ Y]; the then the userdel -rf I $ user- elif [$ = n-SS]; the then Continue the else "input error" Fi the else the useradd user- $ I IF [-eq $ 0?]; the then echo " user- $ i successfully created " passwd =" user`cat / dev / urandom | head -1 | md5sum | head 5` -c " echo" user- $ i: $ passwd "chpasswd echo "user-$i--$passwd" >> aa.txt the else echo "$ i user- creation failed." - fi - fi Done