String comparison in bash. [[: not found

后端 未结 7 1401
故里飘歌
故里飘歌 2020-11-29 17:40

I am trying to compare strings in bash. I already found an answer on how to do it on stackoverflow. In script I am trying, I am using the code submitted by Adam in the menti

7条回答
  •  囚心锁ツ
    2020-11-29 18:24

    If you know you're on bash, and still get this error, make sure you write the if with spaces.

    [[1==1]] # This outputs error
    
    [[ 1==1 ]] # OK
    

提交回复
热议问题