mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Updated SC2015 (markdown)
@@ -31,14 +31,13 @@ If an `if` clause is used instead, this problem is avoided.
|
|||||||
|
|
||||||
### Boring detail:
|
### Boring detail:
|
||||||
|
|
||||||
|
|
||||||
We can think of the example above as
|
We can think of the example above as
|
||||||
```sh
|
```sh
|
||||||
((([[ $dryrun ]]) && echo "Would delete file") || rm file)
|
((([[ $dryrun ]]) && echo "Would delete file") || rm file)
|
||||||
```
|
```
|
||||||
expressing the left-associativity of the `&&` `||` operators.
|
expressing the left-associativity of the `&&` `||` operators.
|
||||||
|
|
||||||
Whenever a command (strictly, a pipeline) succeeds or fails, the execution proceeds following the next `&&` (for success) or `||` (for failure).
|
Whenever a command (strictly, a pipeline) succeeds or fails, the execution proceeds following the next `&&` (for success) or `||` (for failure). (More strictly, the parentheses should be replaced with `{ command; }` to avoid making a subshell, but that's ugly and boring.)
|
||||||
|
|
||||||
### Exceptions
|
### Exceptions
|
||||||
Ignore this warning when you actually do intend to run C when either A or B fails.
|
Ignore this warning when you actually do intend to run C when either A or B fails.
|
||||||
|
Reference in New Issue
Block a user