From aa6b230e7f5f30176d878774539fcc56f3d28463 Mon Sep 17 00:00:00 2001 From: Eisuke Kawashima Date: Tue, 29 Jul 2025 10:57:38 +0900 Subject: [PATCH] Updated SC2149 (markdown) --- SC2149.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/SC2149.md b/SC2149.md index 51f8b3d..a296e03 100644 --- a/SC2149.md +++ b/SC2149.md @@ -4,7 +4,7 @@ _Note: Removed in [v0.5.0 - 2018-06-01](https://github.com/koalaman/shellcheck/c ### Problematic code: -```sh +```bash # Regular array index=42 echo $((array[$index])) @@ -12,7 +12,7 @@ echo $((array[$index])) or -```sh +```bash # Associative array index=banana echo $((array[$index])) @@ -20,7 +20,7 @@ echo $((array[$index])) ### Correct code: -``` +```bash # Regular array index=42 echo $((array[index])) @@ -28,7 +28,7 @@ echo $((array[index])) or -```sh +```bash # Associative array index=banana echo $((array[\$index])) @@ -40,7 +40,7 @@ For a numerically indexed array, the `$` is mostly pointless and can be removed For associative arrays, the `$` should be escaped to avoid accidental dereferencing: -```sh +```bash declare -A array index='$1' array[$index]=42