SHELL脚本中怎么判断输入参数为空

2025-04-17 08:05:40
推荐回答(1个)
回答1:

if [ $# -eq 0 ]; then # 通过$#取得脚本参数数目
    echo "Argument(s) required!"
    exit 1
fi