Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SC2086: variable from the braces expand loop for i in {0..10} #3059

Open
1 of 4 tasks
A4-Tacks opened this issue Sep 18, 2024 · 0 comments
Open
1 of 4 tasks

SC2086: variable from the braces expand loop for i in {0..10} #3059

A4-Tacks opened this issue Sep 18, 2024 · 0 comments

Comments

@A4-Tacks
Copy link

For bugs

  • Rule Id: SC2086
  • My shellcheck version:
    ShellCheck - shell script analysis tool
    version: 0.9.0
    license: GNU General Public License, version 3
    website: https://www.shellcheck.net
    
  • The rule's wiki page does not already cover this (e.g. https://shellcheck.net/wiki/SC2086)
  • I tried on https://www.shellcheck.net/ and verified that this is still a problem on the latest commit

For new checks and feature suggestions

Here's a snippet or screenshot that shows the problem:

#!/usr/bin/bash
for i in {0..10}; do
    echo $i
done
for i in {a..z}; do
    echo $i
done
for i in {0..20..4}; do
    echo $i
done

Here's what shellcheck currently says:


In - line 3:
    echo $i
         ^-- SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    echo "$i"


In - line 6:
    echo $i
         ^-- SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    echo "$i"


In - line 9:
    echo $i
         ^-- SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    echo "$i"

For more information:
  https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...

Here's what I wanted or expected to see:

no warnings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant