Skip to content

SC2086 misleading when word-splitting is *desired* #538

@bittorf

Description

@bittorf
#!/bin/sh

X="a b c"
set -f  # disable globbing
set -- $X
set +f  # enable globbing
echo $1
echo $2
echo $3

please dont warn here. "set -- $VAR" is a common way for splitting into subwords.
what still applies, is 'globbing', but it should not be warned when globbing is inactive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions