问题描述
- linux 脚本 批量添加用户
-
! /bin/shi=1
awk 'BEGIN{FS=":";}{print$3}'/etc/passwd>uid_list
temp='tail -1 uid_list'
while[$i -le 100]
do
mkdir /home/test/student$[i]
temp=$(($i+1))echo "student$[i]:x:${temp}:100:student${i}:/home/test/student${i}:/bin/bash">>/etc/passwd
echo "studnet${i}: :16487:0:099999:7:::">>/etc/shadow
i=$(($i+1))done
这样写可以吗
为什么不执行
解决方案
http://blog.chinaunix.net/uid-27126319-id-3262252.html
http://www.cnblogs.com/lanxuezaipiao/archive/2012/12/01/2797440.html
解决方案二:
http://www.jb51.net/article/58865.htm
时间: 2025-01-03 20:03:53