Skip to content
This repository was archived by the owner on May 11, 2018. It is now read-only.

"Unbound variable" error when using $@ #4

@Potherca

Description

@Potherca

On OSX using $@ results in an "unbound variable" error when a script is called without parameters.

To negate this effect, ${@:-} should be used. (No, that is not a fancy smiley... :- checks whether the variable is unset or empty. If you want to check only whether it's unset, use - i.e. ${@-}).

After it has been verified this does not cause unwanted side-effects in newer bash versions, all offending scripts need to be updated and a linter needs to be added.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions