vault backup: 2024-05-30 18:09:46
This commit is contained in:
parent
fe341a97f9
commit
5e9179d9ff
@ -35,6 +35,16 @@ if somecommand; then
|
|||||||
fi
|
fi
|
||||||
```
|
```
|
||||||
Note that the if statement is terminated by `fi`. This is fairly standard throughout bash scripting, where the blocks are closed with the reverse text used to open them.
|
Note that the if statement is terminated by `fi`. This is fairly standard throughout bash scripting, where the blocks are closed with the reverse text used to open them.
|
||||||
|
|
||||||
|
You can also make use of `else` for more complex conditional logic:
|
||||||
|
```
|
||||||
|
if somecommand; then
|
||||||
|
# If the command succeed
|
||||||
|
else
|
||||||
|
echo root is missing from the password file
|
||||||
|
fi
|
||||||
|
```
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
| Command | Description |
|
| Command | Description |
|
||||||
| ----------------- | ---------------------------------------------------------------------------------------------- |
|
| ----------------- | ---------------------------------------------------------------------------------------------- |
|
||||||
|
Loading…
Reference in New Issue
Block a user