shell 脚本之 批量添加用户

#!/bin/bash

if [ $# -eq 0 ];then

        echo "Please provide the user roster file!"

        exit 1

fi

if [ ! -f ];then

        echo "Please refer to the correct roster file!"

        exit 2

fi

for i in $(cat $1)

do

        userdel -r $i

done

你可能感兴趣的:(shell 脚本之 批量添加用户)