-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Ranges can only match single char #3140
Comments
I understand what you are reaching towards but this is frankly speaking a pretty lazy and bad issue description. Ignore the problem with a directive. |
Please do not ignore this shellcheck message. It is completely valid and refers to a bug in your shell script. Please quote your strings properly, single quotes don't hurt. Example: touch .i
echo '{"i": "hello bug"}' | jq -r .[\"input-decimal\"]
# prints hello bug |
We are still guessing though as the issue description is not clear. To me this report is invalid and should be closed. |
The intent is pretty clear I think. @xubuntu4iran wants to extract the field But because he doesn't quote this JQ code correctly it will be interpreted as a glob by the shell and it will blow up in his face if by chance any file matching
Agreed. 100% not a bug in shellcheck. |
Description added to first post, @sideeffect42 how to edit my script if it is not a bug |
for me , it printed null |
@xubuntu4iran: like I had written already, you have to quote your JQ code: comp=$(sed -n "${j}p" "${filename}" | jq -r '.["input-decimal"]')
You have to run the complete example I posted. Or run just |
v0.10.0 stable release used
I used sed to extract a line from a file which is a json object, so I used jq to extract json element
The text was updated successfully, but these errors were encountered: