Created
December 31, 2021 08:38
-
-
Save seahal/389bf6f97d0e51eee280a77df4eb8ba3 to your computer and use it in GitHub Desktop.
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
| #!/bin/bash | |
| # "0" と "0" の比較をすると、0 という値が返ってくる | |
| test "0" == "0" | |
| echo $? | |
| # "0" と "1" の比較をすると、1 という値が返ってくる | |
| test "0" == "1" | |
| echo $? | |
| # それはすなわち、bash では 0 は true で 1 は false なのではないか? | |
| for i in {'0','1'}; do | |
| if test '0' == $i; then | |
| echo "$? is true" | |
| else | |
| echo "$? is false" | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment