From deccfb5aab8bafc96250ceb6a45c09bd974f53f0 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Mon, 18 Jun 2018 22:38:57 +0100 Subject: [PATCH] Updated SC2181 (markdown) --- ...d => SC2181-tell-inverting-return-value-will-overwrite-it.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename SC2181.md => SC2181-tell-inverting-return-value-will-overwrite-it.md (96%) diff --git a/SC2181.md b/SC2181-tell-inverting-return-value-will-overwrite-it.md similarity index 96% rename from SC2181.md rename to SC2181-tell-inverting-return-value-will-overwrite-it.md index f09c148..9191825 100644 --- a/SC2181.md +++ b/SC2181-tell-inverting-return-value-will-overwrite-it.md @@ -33,7 +33,7 @@ Apart from the redundancy, there are other reasons to avoid this pattern: To check that a command returns success, use `if mycommand; then ...`. -To check that a command returns failure, use `if ! mycommand; then ...`. +To check that a command returns failure, use `if ! mycommand; then ...`. Notice that `!` will overwrite `$?` value. To additionally capture output with command substitution: `if output=$(mycommand); then ...`