#!/bin/bash UserId=$1 UserIdEnd=$2 UserData="/etc/passwd" Nulls="/dev/null" #echo $UserId #echo `expr $UserId + 1` #`expr $UserId + 1 >$Nulls 2>&1` if [[ -z $UserId ]] || [[ `expr $UserId + 1 >$Nulls 2>&1`$? -ne 0 ]];then echo $? echo "请传入合法的参数,必须是整数!" exit fi if [ -z $UserIdEnd ];then UserIdEnd=`awk -F":" 'END{print $3}' $UserData` fi echo "开始ID "$UserId echo "结束ID "$UserIdEnd if [ $UserIdEnd -gt $UserId ];then for ((i=$UserId;i<=$UserIdEnd;i++)) do UserName=`awk -F":" '/:'$i':/{print \$1}' $UserData` #echo "awk -F\":\" '/$i/{print \$1}' $UserData" echo "正在删除:"$i"-----"$UserName userdel -r $UserName >$Nulls 2>&1 done fi
最新评论
# 这只是一个创建远程登录并授权的语句、仅作为记录 GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'Fit2cloud!' WITH GRANT OPTION;
当MGR集群初始化结束后,需要开启MGR集群自启动(需要有一台节点是自动开启引导) loose-group_replication_start_on_boot = ON #设置节点是否在启动时自动启动 MGR 集群 loose-group_replication_bootstrap_group = ON #设置节点是否作为初始引导节点启动集群
密码:blog.sirliu.com
本内容密码:blog.sirliu.com 最新整理的文章在这里喔:https://blog.sirliu.com/2018/11/shell_lian_xi_ti.html