From 08bb9828ec6c6bfd4a6ab437e9445c0828f64328 Mon Sep 17 00:00:00 2001 From: timvisee Date: Wed, 3 Mar 2021 00:30:00 +0100 Subject: [PATCH] Improve notice of running commands as single expression in last post --- content/blog/2021-03-02_elegant-bash-conditionals/index.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/content/blog/2021-03-02_elegant-bash-conditionals/index.md b/content/blog/2021-03-02_elegant-bash-conditionals/index.md index bae6df9..318407c 100644 --- a/content/blog/2021-03-02_elegant-bash-conditionals/index.md +++ b/content/blog/2021-03-02_elegant-bash-conditionals/index.md @@ -152,10 +152,11 @@ commands after all. Bash also has `[[`, which is [different](https://stackoverflow.com/q/13542832/1000145) from `[`. -You can execute blocks of commands by wrapping it with `{ expr }`. For example: +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`.