使用VI编写一个SHELL脚本程序

2025-03-10 14:30:15
推荐回答(1个)
回答1:

你好,脚本如下:
----------------------------------------------------------------
#!/bin/bash
read -p "Please input user name:" name
read -p "Please input the password:" pass
if [ -z $name ];then
echo "Sorry,please input a user name!" && exit 0
else
useradd $name -p $pass
fi
---------------------------------------------------------------
希望我的回答对你有帮助 ,有疑问可咨询扣扣4578004