mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Updated SC2015 (markdown)
@@ -21,7 +21,7 @@ However, combining them into `A && B || C` is not the same as `if A then B else
|
|||||||
|
|
||||||
In this case, if `A` is true but `B` is false, `C` will run.
|
In this case, if `A` is true but `B` is false, `C` will run.
|
||||||
|
|
||||||
For the code sample above, if the script was run with stdout closed for any reason (such as explicitly running `script --dryrun >&-`), echo would fail and return false and the file would be deleted, even though `$dryrun` was set!
|
For the code sample above, if the script was run with stdout closed for any reason (such as explicitly running `script --dryrun >&-`), echo would fail and the file would be deleted, even though `$dryrun` was set!
|
||||||
|
|
||||||
If an `if` clause is used instead, this problem is avoided.
|
If an `if` clause is used instead, this problem is avoided.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user