function checkParm(){
if [ ! -n "$1" ];then
echo "Parm Doesn't exist,don't run this shell"
exit 1
fi
}
checkParm
主要是通过第一个参数判断,脚本是否有入参,如果无入参则退出脚本执行,返回异常退出码1
function checkParm(){
if [ ! -n "$1" ];then
echo "Parm Doesn't exist,don't run this shell"
exit 1
fi
}
checkParm
主要是通过第一个参数判断,脚本是否有入参,如果无入参则退出脚本执行,返回异常退出码1