- 论坛徽章:
- 6
|
本帖最后由 a5love3n 于 2021-09-09 11:36 编辑
我在8.3环境下测试你的脚本没有问题,用的是你最开始的脚本
- ./add.sh
- Changing password for user test.
- passwd: all authentication tokens updated successfully.
- Added user test.
- [root@localhost ~]# cat add.sh
- #!/bin/bash
- for i in `awk '{print $1}' myusers.list `
- do
- useradd $i
- grep "\<$i\>" myusers.list | awk '{print $2}' | passwd --stdin $i
- grep "\<$i\>" myusers.list | awk '{print $2"\n"$2}' | smbpasswd -a $i -s
- done
复制代码 根据你的myuserlist文件内容,我删除了 -F":"
- cat /etc/redhat-release
- CentOS Linux release 8.3.2011
复制代码
你的这个报错,像是文本格式问题 |
|