📜  bash 参数计数 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:49:51.344000             🧑  作者: Mango

代码示例1
# use $#

# say if you are expecting exactly 2 parameters
# -ne is bash's way of saying not equal
if [[ "$#" -ne 2 ]]; then
    echo "this script needs exactly 2 parameters"
    exit 1
 fi