1
0
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:
Rico Sta. Cruz
2020-06-13 10:16:20 +10:00
committed by GitHub

18
bash.md
View File

@@ -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
```