[root@centos7 ~]#cat user.sh
#!/bin/bash
#
#*************************************************************
#Author: chenchengpei
#QQ: 2088346053
#Date: 2022-01-04
#FileName: user.sh
#Description: The test script
#Copyright (C): 2022 All rights reserved
#*************************************************************
for i in {1..10};do
id user$i &> /dev/null || useradd user$i
pass=`openssl rand -base64 12`
echo $pass | passwd --stdin user$i &> /dev/null
echo user$i:$pass >> user.txt
done