Modified Bash Cheatsheet

This commit is contained in:
Jun Wei Woon 2020-07-06 21:00:32 +08:00
parent a0c689bd32
commit b05c0a470e
1 changed files with 12 additions and 10 deletions

View File

@ -128,16 +128,18 @@ else
fi fi
``` ```
# Conditions # Conditions
| Operator | Description | | Operator | Description |
|----------|----------------------| |----------|--------------------------|
| -eq | Equal | | -eq | Equal |
| -lt | Less than | | -lt | Less than |
| -ge | Greater than | | -le | Less than or equal to |
| == | 2 Strings equal | | -gt | Greater than |
| != | 2 Strings not equal | | -ge | Greater than or equal to |
| ! | Statement is false | | == | 2 Strings equal |
| -d | Directory is present | | != | 2 Strings not equal |
| -e | File is present | | ! | Statement is false |
| -d | Directory is present |
| -e | File is present |
## Condition Usage Examples ## Condition Usage Examples
``` bash ``` bash