diff --git a/SC2181.md b/SC2181.md index 9191825..85de623 100644 --- a/SC2181.md +++ b/SC2181.md @@ -35,7 +35,7 @@ To check that a command returns success, 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 ...` +To additionally capture output with command substitution: `if ! output=$(mycommand); then ...` This also applies to `while`/`until` loops.