How to use bitwise operators in if statements?

前端 未结 3 759
迷失自我
迷失自我 2021-02-07 08:33

I want to write something like this:

if [[ ( releases[\"token\"] & $MASK ) -eq 1 ]]; then

but I get the error that:

3条回答
  •  心在旅途
    2021-02-07 08:56

    In if statement:

    if (((releases["token"] & $MASK) == 1)); then 
      echo YES
    else 
      echo NO
    fi
    

提交回复
热议问题