The single and double equal signs are arithmetic operators. “-eq” is a relational operator

Single and double equals

Equivalence in the conditional expression “[]” can be used to compare strings to strings or to compare integers to integers.

In the arithmetic expression “(())”, the single equal sign is the assignment arithmetic operator, and the double equal sign is the equality arithmetic operator.

“-eq”

The equality operator ‘-eq’ cannot be used in the arithmetic expression ‘(())’. It can only be used for equality comparisons of integer Integers.

Single and double equals

Equivalence in the conditional expression “[]” can be used to compare strings to strings or to compare integers to integers.

In the arithmetic expression “(())”, the single equal sign is the assignment arithmetic operator, and the double equal sign is the equality arithmetic operator.

“-eq”

The equality operator ‘-eq’ cannot be used in the arithmetic expression ‘(())’. It can only be used for equality comparisons of integer Integers.

### Read More:

- Using greater than sign or less than sign to report error in mybatis
- Shell script – EQ – Ne – GT – LT – ge – le
- geom_ Warning message: sign function’s own error
- [depth concept] · introduction of EER (equal error rate)
- Must have equal len keys and value when setting with an Iterable
- Under Linux, git cannot be used, prompt sign_and_send_pubkey: signing failed: agent refused operation
- Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.6:sign
- Markdown and latex: approximately equal to the writing of symbols
- In Linux shell script, about the commonly used flag [- EQ, GT..] in test and if judgment
- command/usr/bin/codesign failed with exit code 1- code sign error
- Driver IRQL Not Less or Equal (rtwlane.sys) blue screen restart problem win8.1
- Wrong classification of Python — assertion cur_ Target is greater than or equal to 0 and cur_ Target is less than n_ classes failed
- Differences between shell script variable assignment and C language variable assignment
- Invalid operands to binary expression (‘double’ and ‘double’)
- Shell removes double quotes from strings
- Shell script syntax error near unexpected token ‘$’Do
- Exponentiation in shell
- If elif writing method of shell script
- Info:Memory module [DIMM] needs attention: Single-bit warning error rate exceeded, Single-bit fai…
- When executing shell script, $’r ‘: command not found appears