From a40c6b465ed43bf4d4aeaa967cb5e48dd4674ac0 Mon Sep 17 00:00:00 2001 From: Eisuke Kawashima Date: Tue, 29 Jul 2025 10:41:42 +0900 Subject: [PATCH] Updated SC2251 (markdown) --- SC2251.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SC2251.md b/SC2251.md index 0be5b47..d651fac 100644 --- a/SC2251.md +++ b/SC2251.md @@ -27,8 +27,8 @@ Adding `|| exit ` will instead exit with failure when the command succeeds. ShellCheck will not detect cases where `$?` is implicitly or explicitly used to check the value afterwards: -``` -set -e; +```sh +set -e check_success() { [ $? -eq 0 ] || exit 1; } ! false; check_success ! true; check_success