Linux简单的运用
实现创建100个用户
(1):1-9 (2):10 20 30 40......
实现创建一个组
实现删除100的用户
实现删除组
i=0 n=0 groupadd jiben18 while [ "$i" != "300" ] do if (( "$i" < 10 ));then i=$(($i+1)) else (( "$i" > 10 )) i=$(($i+10)) fi if (( "$i" < 10 ));then n="00$i" elif (( "$i" < 100));then n="0$i" else n="$i" fi useradd "jiben"$n -g "jiben18" echo "jiben"$n echo 123456 |passwd jiben$n --stdin &>/dev/null done echo "********* Group information *********" tail -3 /etc/group echo "********* User information *********" tail -3 /etc/passwd #!/bin/bash n=0 for((i=1;i<=300;i++)); do if (( "$i" > 10 ));then i=$(($i+9)) fi if (( "$i" < 10 ));then n="00$i" elif (( "$i" < 100));then n="0$i" else n="$i" fi userdel "jiben"$n done groupdel jiben18 echo "********* Group information *********" tail -3 /etc/group echo "********* User information *********" tail -3 /etc/passwd