The test command
To evaluate the conditional expressions the test command is used.
Syntax
test expression
or
[ expression ]
For applying Integer Operator using test command
int1 -eq int2 Returns true if int1 is equal to int2
|
int1 -ge int2 Returns true if int1 is greater than or equal to int2
|
int1 -gt int2 Returns true if int1 is greater than int2
|
int1 -le int2 Returns true if int1 is less than or equal to int2
|
int1 -lt int2 Returns true if int1 is less than int2
|
int1 -ne int2 Returns true if int1 is not equal to int2
|
Table 1
For Applying String Operator using test command

Table 2


Table 3
For Applying File Operator using test command

Table 4