mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
missing the !
in example, see https://github.com/koalaman/shellcheck/issues/782
@@ -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.
|
||||
|
||||
|
Reference in New Issue
Block a user