1.判断有无参数输入:
#!/bin/bash
if [ $# -eq 0 ];then
echo “Usages:$0 [options]”
exit 2
fi
测试:./test.sh
2.用shell脚本添加用户:
#vim test.sh
#!/bin/bash
if [ $# -eq 0 ];then
echo "Usages:$0 [username]"
1.判断有无参数输入:
#!/bin/bash
if [ $# -eq 0 ];then
echo “Usages:$0 [options]”
exit 2
fi
测试:./test.sh
2.用shell脚本添加用户:
#vim test.sh
#!/bin/bash
if [ $# -eq 0 ];then
echo "Usages:$0 [username]"