Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using `if [` works differently than `if [[` (the former single square bracket is a file, the double one is a builtin function (I think)). When using `if [` with `-eq`, it expects numbers, but `==` can deal with strings, which is what we want here. Some examples: ```bash $ if [ hello -eq hello ]; then echo yes; fi bash: [: hello: integer expression expected $ if [ hello == hello ]; then echo yes; fi yes $ if [ 1 -eq 1 ]; then echo yes; fi yes $ if [[ hello -eq hello ]]; then echo yes; fi yes $ if [[ 1 -eq 1 ]]; then echo yes; fi yes ```
- Loading branch information