Last active
June 17, 2020 11:44
-
-
Save thejhh/bf4abc27e915dc294712df3127594a5e to your computer and use it in GitHub Desktop.
bash test vs [ ]
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
| $ test "$memmb" -gt 4000 | |
| -bash: test: : integer expression expected | |
| $ test $memmb -gt 4000 | |
| -bash: test: -gt: unary operator expected | |
| $ [ $memmb -gt 4000 ] | |
| -bash: [: -gt: unary operator expected | |
| $ [ "$memmb" -gt 4000 ] | |
| -bash: [: : integer expression expected | |
| $ [ "$memmb" -gt 4000 | |
| -bash: [: missing `]' | |
| $ [ "$memmb" -gt 4000 ] | |
| -bash: [: ! 123: integer expression expected | |
| $ [ $memmb -gt 4000 ] | |
| $ echo $? | |
| 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment