为变量设置默认值
#!/bin/bash read -p "请输入用户名:" n useradd $n read -p "请输入密码:" p echo "${p:-12345}" | passwd --stdin $n #12345是新建用户密码的初值
京公网安备 11010502049817号