3 ms·
Google's styleguide has incorrect bash being used, they are using string comparison operators for numeric comparisons (see the various `$? != 0` and $PIPESTATUS
by ancientsofmumu 5y ago
Google's styleguide has incorrect bash being used, they are using string comparison operators for numeric comparisons (see the various `$? != 0` and $PIPESTATUS).
[[ -1 -eq 0-1 ]] && echo true || echo false
[[ -1 == 0-1 ]] && echo true || echo false
https://www.gnu.org/software/bash/manual/html_node/Bash-Conditional-Expressions.html https://www.gnu.org/software/bash/manual/html_node/Bash-Cond...
- esprehn 5y agoThe style guide always uses (( so the operators are numerical comparison. See also where it says: > For preference, don’t use [[ … ]] at all for numeric comparisons, use (( … )) instead.