#!/bin/bash
if [ ! "$1" ]
then
echo "Usage:/root/batchusers userfile"
exit 1
fi
if [ ! -e "$1" ]
then
echo "Input file not found"
exit 1
fi
for name in `cat $1`
do
useradd $name -s ‘/bin/false‘
done
原文:https://blog.51cto.com/sampsondotqiu/2501994