标签:use create bin failed users exist des ready roo
#!/bin/bash
read -p "Enter password:" PASSWD
for UNAME in `cat /root/Desktop/users.txt`
do
id $UNAME &> /dev/null
if [ $? -eq 0 ]
then
echo "Already existed"
else
useradd $UNAME &> /dev/null
echo "$PASSWD" | passwd --stdin $UNAME
if [ $? -eq 0 ]
then
echo "$UNAME Create success"
else
echo "$UNAME Create failed"
fi
fi
done
标签:use create bin failed users exist des ready roo
原文地址:https://blog.51cto.com/sampsondotqiu/2490642