博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
删除批量增加用户的shell script
阅读量:7218 次
发布时间:2019-06-29

本文共 583 字,大约阅读时间需要 1 分钟。

hot3.png

#!/bin/bash

#Shell name: more_userdel.sh
#
#Program:
# del some users using more_useradd.sh or more-user_theory.sh
#Author: pero
#Email:  
#
#History:
# 2012/7/20
#
#If you have any opinion please contact me

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:.

export PATH

if [ $UID -ne 0 ]

then
  echo "Run as root"
  exit 1
fi

read -p "Please input a username to del:" name

read -p "Please input a number of user to del:" num

sum=1

while [ $sum -le $num ]
do
 userdel -r $name$sum
 sum=`expr $sum + 1`

done

echo "It is ok..."

转载于:https://my.oschina.net/fufangchun/blog/75001

你可能感兴趣的文章
SCU 3132(博弈)
查看>>
正则表达式
查看>>
delete archivelog all 无法彻底删除归档日志?
查看>>
Redis五大数据类型
查看>>
大型分布式网站架构技术总结
查看>>
矩阵求导与投影梯度相关问题
查看>>
SVN
查看>>
C语言编程写的一个http下载程序(王德仙)2012-04-08
查看>>
CCF201409-3 字符串匹配(100分)
查看>>
UVALive2203 UVa10042 Smith Numbers【质因数分解+素数判定+数位之和】
查看>>
Project Euler Problem 9: Special Pythagorean triplet
查看>>
HDU5701 中位数计数【中位数】
查看>>
Python 深浅拷贝 (Shallow copy and Deep copy in Python)
查看>>
Axure
查看>>
屏幕截取工具
查看>>
C语言第七次作业---要死了----
查看>>
Jquery事件绑定冲突
查看>>
偶现bug如何处理?
查看>>
yum命令简介
查看>>
【Udacity】朴素贝叶斯
查看>>