mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Updated SC2319 (markdown)
@@ -47,7 +47,7 @@ In the second problematic example, `exit $?` will always `exit 0`, because it on
|
|||||||
|
|
||||||
### Exceptions:
|
### Exceptions:
|
||||||
|
|
||||||
If you intentionally refer to a condition to get its exit status, as in `[ -e file ]; exists=$?`, you can ignore this warning. Alternatively, write it out as in `if ! [ -e file ]; then exists=0; else exists=1; fi`.
|
None. Note that ShellCheck does not warn if the usage of `$?` after `[ .. ]` is unconditional, as in `[ -d dir ]; return $?`.
|
||||||
|
|
||||||
### Related resources:
|
### Related resources:
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user