错误代码示例
if ! [ $# -eq 0 || $# -eq 1 ]; then
exit 1
fi
正确代码示例
if ! [[ $# -eq 0 || $# -eq 1 ]]; then //注意中括号
exit 1
fi
错误代码示例
if ! [ $# -eq 0 || $# -eq 1 ]; then
exit 1
fi
正确代码示例
if ! [[ $# -eq 0 || $# -eq 1 ]]; then //注意中括号
exit 1
fi