Created
May 16, 2015 16:36
-
-
Save 178inaba/246bd78005b78cc453b5 to your computer and use it in GitHub Desktop.
角括弧2個([[ 条件式 ]])の条件式でAND条件「-a」が使えない件(回避方法あり) ref: http://qiita.com/inaba178/items/b02662c3645595659156
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ [[ 11 -eq 11 -a "bb" = "bb" ]]; echo $? | |
-bash: syntax error in conditional expression | |
-bash: syntax error near `-a' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ [[ 11 -eq 11 && "bb" = "bb" ]]; echo $? | |
0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ [[ 11 -eq 11 -o "bb" = "ab" ]]; echo $? | |
-bash: syntax error in conditional expression | |
-bash: syntax error near `-o' | |
$ [[ 11 -eq 11 || "bb" = "ab" ]]; echo $? | |
0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment