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

SC2006 triggered with quotes and backtics misinterpreted #3009

Open
onkobu opened this issue Jun 27, 2024 · 0 comments
Open

SC2006 triggered with quotes and backtics misinterpreted #3009

onkobu opened this issue Jun 27, 2024 · 0 comments

Comments

@onkobu
Copy link

onkobu commented Jun 27, 2024

For bugs

  • Rule Id SC2006

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

#!/bin/bash
local count="$(aws s3api list-buckets --output text --query 'Buckets[?starts_with(Name,`'"$bucketPattern"'`)].Name' | wc -w)"

Here's what shellcheck currently says:

SC2006 (style): Use $(...) notation instead of legacy backticks ...

Here's what I wanted or expected to see:

No warning, The backticks are in two separate strings with even a variable in between. AWS CLI requires this syntax with backticks in --query parameter. Basically this combines a double quoted string containing a single quote and a backtick with a variable and a second string closing backticks and single quote.

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