首页 > 代码库 > 测试

测试

#!/bin/bash
#
Count=0

for UserName in $@; do
  if id $UserName &> /dev/null; then
    echo "$UserName exists."
  else
    useradd $UserName
    echo "Add $UserName successfully."
    Count=$[$Count+1]
  fi
done

echo "Add $Count new users."