diff --git a/SC2155.md b/SC2155.md index db4763b..071546f 100644 --- a/SC2155.md +++ b/SC2155.md @@ -50,9 +50,9 @@ foo=$(mycmd) The exit status of the command is overridden by the exit status of the creation of the local variable. For example: ```bash -$ f() { local foo=$(false) && echo "silent error happened"; }; f -silent error happened -$ f() { local foo; foo=$(false) && echo "silent error happened"; }; f +$ f() { local foo=$(false) && echo "error was hidden"; }; f +error was hidden +$ f() { local foo; foo=$(false) && echo "error was hidden"; }; f ``` ### Problematic code in the case of `readonly`: