#!/bin/bash
#function:userdel
#author:zdj
#time:201-7-23
uid=`cat /etc/passwd|awk -F: '{print $3}'|egrep '[5-9][0-9][0-9]'`
if [ $? -eq 0 ];
then
echo -e "\033[41;37m 你的电脑有其他用户:
`cat /etc/passwd|awk -F: '{print $1,$3}'|egrep '[5-9][0-9][0-9]'`\033[0m";
user_Name=`cat /etc/passwd|awk -F: '{print $1,$3}'|egrep '[5-9][0-9][0-9]'|awk '{print $1}' >user_Name.txt`
num=`cat /etc/passwd|awk -F: '{print $3}'|egrep '[5-9][0-9][0-9]'|wc -l`
for ((i=1;i<=$num;i++)) ;
do
user_name=`cat user_Name.txt|head -$i|tail -1`
echo `userdel -r $user_name`;
done
else
echo -e "\033[42;37m 你的电脑没有其他用户\033[0m"
fi
#function:userdel
#author:zdj
#time:201-7-23
uid=`cat /etc/passwd|awk -F: '{print $3}'|egrep '[5-9][0-9][0-9]'`
if [ $? -eq 0 ];
then
echo -e "\033[41;37m 你的电脑有其他用户:
`cat /etc/passwd|awk -F: '{print $1,$3}'|egrep '[5-9][0-9][0-9]'`\033[0m";
user_Name=`cat /etc/passwd|awk -F: '{print $1,$3}'|egrep '[5-9][0-9][0-9]'|awk '{print $1}' >user_Name.txt`
num=`cat /etc/passwd|awk -F: '{print $3}'|egrep '[5-9][0-9][0-9]'|wc -l`
for ((i=1;i<=$num;i++)) ;
do
user_name=`cat user_Name.txt|head -$i|tail -1`
echo `userdel -r $user_name`;
done
else
echo -e "\033[42;37m 你的电脑没有其他用户\033[0m"
fi