I am trying to do a simple condition check, but it doesn't seem to work.
(我正在尝试进行简单的条件检查,但它似乎不起作用。)
If $#
is equal to 0
or is greater than 1
then say hello.
(如果$#
等于0
或大于1
则说出你好。)
I have tried the following syntax with no success:
(我尝试了以下语法但没有成功:)
if [ "$#" == 0 -o "$#" > 1 ] ; then
echo "hello"
fi
if [ "$#" == 0 ] || [ "$#" > 1 ] ; then
echo "hello"
fi
ask by Strawberry translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…