How to do a logical OR operation in shell scripting

前端 未结 8 2206
小蘑菇
小蘑菇 2020-11-27 08:55

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 he

8条回答
  •  一整个雨季
    2020-11-27 09:42

    Sometimes you need to use double brackets, otherwise you get an error like too many arguments

    if [[ $OUTMERGE == *"fatal"* ]] || [[ $OUTMERGE == *"Aborting"* ]]
      then
    fi
    

提交回复
热议问题