From 7a5d18e4ed27031ad359c297392f3a523553c351 Mon Sep 17 00:00:00 2001 From: Joachim Ansorg Date: Mon, 31 Oct 2022 15:30:25 +0100 Subject: [PATCH] Updated SC3009 (markdown) --- SC3009.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/SC3009.md b/SC3009.md index 974067f..7748c96 100644 --- a/SC3009.md +++ b/SC3009.md @@ -1,9 +1,21 @@ -**In POSIX `sh`, brace expansion is undefined.** +## In POSIX `sh`, brace expansion is undefined. + +### Problematic code: -Problematic code: ``` #!/bin/sh for i in {1..5}; do ... ``` + Here, `$i` expands to `{1..5}`. It does **not** expand to the sequence `1 2 3 4 5` + +### Correct code: + +For simple sequences of numbers, you may use the `seq` command, e.g. `seq 1 5`. + +### Rationale: + +### Exceptions: + +None