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

Giving multiple arguments causes an error #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AN3223
Copy link

@AN3223 AN3223 commented Dec 30, 2019

Normally quoting a string will prevent word-splitting, but $@ is (weirdly) a special case and it will give unexpected arguments to [ which will cause an error like this:
./xbps-mini-builder: 61: [: <package name>: unexpected operator

$* is equivalent to $@ but without this weird behavior.

I recommend using shellcheck to lint your shell code, it will catch stuff like this (also adding set -e to the top of your scripts will prevent errors like this one from being trampled over).

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

Successfully merging this pull request may close these issues.

1 participant