通过位置变量创建 Linux 系统账户及密码
vim name.sh
#!/bin/bash
useradd "$1"
echo "$2" | passwd --stdin "$1"
[root@ localhost ~]# sh name.sh szm 123
Changing password for user szm.
passwd: all authentication tokens updated successfully.