mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:37:35 +00:00
parent
5b79d0d1a3
commit
ffd74a2c5a
1 changed files with 2 additions and 2 deletions
|
@ -182,12 +182,12 @@ rm test && echo "deleted!" || echo "failed with $?"
|
|||
|
||||
##### Conditionals
|
||||
Conditionals can either be expressed with the _Logical Relations_, or via explicit `if` expressions.
|
||||
An `if` expression contains at least a _condition_ and a _then clause_, and optionally the `else` keyword followed by an _else clause_.
|
||||
An `if` expression contains at least a _condition_ command and a _then clause_, and optionally the `else` keyword followed by an _else clause_.
|
||||
An _else clause_ may contain another `if` expression instead of a normal block.
|
||||
|
||||
The _then clause_ **must** be surrounded by braces, but the _else clause_ may also be another `if` expression.
|
||||
|
||||
An `if` expression evaluates either the _then clause_ or (if available) the _else clause_, based on the exit code of the _condition_; should the exit code be zero, the _then clause_ will be executed, and if not, the _else clause_ will.
|
||||
An `if` expression evaluates either the _then clause_ or (if available) the _else clause_, based on the exit code of the _condition_ command; should the exit code be zero, the _then clause_ will be executed, and if not, the _else clause_ will.
|
||||
|
||||
###### Examples
|
||||
```sh
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue