- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1.9k
 
SC2335
        Simon Brandt edited this page Aug 19, 2025 
        ·
        2 revisions
      
    and other binary operators such as
- 
=and!=(string) - 
-leand-gt, and so forth (arithmetic) 
if [ ! "$var" -eq 1 ]; then :; fi
if ! [ "$var" = foo ]; then :; fiif [ "$var" -ne 1 ]; then :; fi
if [ "$var" != foo ]; then :; fiDouble negation of such binary operators is unnecessary.
This is a stylistic issue that does not affect correctness. If you prefer the original expression, you can Ignore it with a directive or flag.
This rule is not applied to the followings:
- 
<and>(lexicographical) - 
-ntand-ot(file timestamp) - 
=~(regular expression)