From 702f6917bf1ef135bc29f55f1c0784df9d04e2fb Mon Sep 17 00:00:00 2001 From: Rushen Wang <45029442+dovics@users.noreply.github.com> Date: Tue, 10 Sep 2024 09:31:11 +0800 Subject: [PATCH] Updated SC2245 (markdown) --- SC2245.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SC2245.md b/SC2245.md index 0f12cff..39919fc 100644 --- a/SC2245.md +++ b/SC2245.md @@ -3,6 +3,8 @@ ### Problematic code: ```sh +#!/bin/ksh + if [ -f ksh* ] then echo "The file exists" @@ -12,6 +14,8 @@ fi ### Correct code: ```sh +#!/bin/ksh + for f in ksh* do if [ -f "$f" ]