mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Updated SC2051 (markdown)
@@ -2,17 +2,21 @@
|
||||
|
||||
### Problematic code:
|
||||
|
||||
```bash
|
||||
for i in {1..$n}
|
||||
do
|
||||
echo "$i"
|
||||
done
|
||||
```
|
||||
|
||||
### Correct code:
|
||||
|
||||
```bash
|
||||
for ((i=0; i<n; i++))
|
||||
do
|
||||
echo "$i"
|
||||
done
|
||||
```
|
||||
|
||||
### Rationale:
|
||||
|
||||
@@ -34,4 +38,4 @@ done < <(eval "printf '%s\0' $(printf "{%q..%q}.jpg" "$from" "$to")")
|
||||
|
||||
### Exceptions
|
||||
|
||||
None (if you're writing for e.g. zsh, make sure the shebang indicates this so shellcheck won't warn)
|
||||
None (if you're writing for e.g. zsh, make sure the shebang indicates this so shellcheck won't warn)
|
||||
|
Reference in New Issue
Block a user