From f76882ef602ad574b3e98fd163d4218381fdd489 Mon Sep 17 00:00:00 2001 From: Eisuke Kawashima Date: Tue, 29 Jul 2025 10:58:56 +0900 Subject: [PATCH] Updated SC2144 (markdown) --- SC2144.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/SC2144.md b/SC2144.md index 17f3217..10eadca 100644 --- a/SC2144.md +++ b/SC2144.md @@ -45,15 +45,13 @@ for f in /path/to/your/files*; do done ``` - - ### Exceptions If you are sure there will only ever be exactly 0 or 1 matches -- and `nullglob` is not enabled -- then the test happens to work. You may still want to consider making this assumption explicit and failing fast if it's ever violated: -``` +```bash files=( dir/file* ) [ "${#files[@]}" -ge 2 ] && exit 1 if [ -e "${files[0]}" ]