Skip to content

SC2098 not always "technically" correct #428

@sitsofe

Description

@sitsofe

With

# !/bin/bash
VAR=aaa VAR=${VAR}:bbb bash -c 'echo ${VAR}'

Your result will depend on the version of bash you are running:
bash3:

:bbb

(Sometimes. Try doing

echo $VAR; VAR=aaa VAR=${VAR}:bbb bash -c 'echo ${VAR}'

to see a different result on OSX)

bash4:

aaa:bbb

Either way it's great shellcheck warns about this unstable behaviour!

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