Fix invalid example command in 'Elegant bash conditionals' post

This commit is contained in:
timvisee 2021-05-09 18:46:16 +02:00
parent 0e6f9f2ab2
commit 8907a4421a
No known key found for this signature in database
GPG Key ID: B8DB720BC383E172
1 changed files with 2 additions and 2 deletions

View File

@ -152,11 +152,11 @@ commands after all.
Bash also has `[[`, which is
[different](https://stackoverflow.com/q/13542832/1000145) from `[`.
You can wrap multiple commands with `{ expr }` to run it as single expression in
You can wrap multiple commands with `{ expr; }` to run it as single expression in
your command chain. For example:
```bash
[ $EUID -ne 0 ] && { echo You must be root; exit 1 }
[ $EUID -ne 0 ] && { echo You must be root; exit 1; }
```
The `true` and `false` commands do nothing more than returning `0` or `1`.