mirror of
https://github.com/onkelbeh/cheatsheets.git
synced 2026-08-16 14:04:47 +02:00
Merge pull request #1397 from rajinder-yadav/patch-1
This commit is contained in:
18
bash.md
18
bash.md
@@ -368,13 +368,15 @@ Note that `[[` is actually a command/program that returns either `0` (true) or `
|
||||
| --- | --- |
|
||||
| `(( NUM < NUM ))` | Numeric conditions |
|
||||
|
||||
| Condition | Description |
|
||||
| --- | --- |
|
||||
| `[[ -o noclobber ]]` | If OPTIONNAME is enabled |
|
||||
| --- | --- |
|
||||
| `[[ ! EXPR ]]` | Not |
|
||||
| `[[ X ]] && [[ Y ]]` | And |
|
||||
| `[[ X ]] || [[ Y ]]` | Or |
|
||||
#### More conditions
|
||||
|
||||
| Condition | Description |
|
||||
| -------------------- | ------------------------ |
|
||||
| `[[ -o noclobber ]]` | If OPTIONNAME is enabled |
|
||||
| --- | --- |
|
||||
| `[[ ! EXPR ]]` | Not |
|
||||
| `[[ X && Y ]]` | And |
|
||||
| `[[ X || Y ]]` | Or |
|
||||
|
||||
### File conditions
|
||||
|
||||
@@ -406,7 +408,7 @@ fi
|
||||
|
||||
```bash
|
||||
# Combinations
|
||||
if [[ X ]] && [[ Y ]]; then
|
||||
if [[ X && Y ]]; then
|
||||
...
|
||||
fi
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user