mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Created SC2122 (markdown)
17
SC2122.md
Normal file
17
SC2122.md
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
## >= is not a valid operator. Use '! a > b' instead.
|
||||||
|
|
||||||
|
### Problematic code:
|
||||||
|
|
||||||
|
[[ a <= b ]]
|
||||||
|
|
||||||
|
### Correct code:
|
||||||
|
|
||||||
|
[[ ! a > b ]]
|
||||||
|
|
||||||
|
### Rationale:
|
||||||
|
|
||||||
|
The typical operators `<=` and `>=` are not supported by Bourne shells. Instead of "less than or equal", rewrite as "not greater than".
|
||||||
|
|
||||||
|
### Contraindications
|
||||||
|
|
||||||
|
None
|
Reference in New Issue
Block a user