| Shell
Script Operator |
Numeric |
String |
|---|---|---|
| Equal |
-eq |
= |
| Not Equal |
-ne |
!= |
| Less Than |
-lt |
|
| Less Than or Equal To |
-le |
|
| Greater Than |
-gt |
|
| Greater Than or Equal To |
-ge |
|
| If the file exists |
[ -f file ] |
|
| If the directory exists |
[ -d directory ] |
|
| If the variable has a value |
[ -z variable ] |
|