mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 11:19:45 +08:00
Updated SC2181 (markdown)
@@ -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 ...`
|
||||
|
Reference in New Issue
Block a user