Skip to content

Does ShellCheck not fully support env -S? #3123

Open
@scalisi

Description

@scalisi

On 2021-09-18, @koalaman wrote:

ShellCheck has started supporting env -S

I tested ShellCheck's support for env -S at ShellCheck.net by entering the following code, which produced an SC2164 warning as expected:

#!/usr/bin/env -S bash
cd foo

As expected, the following code does not produce an SC2164 warning:

#!/usr/bin/env -S bash -e
cd foo

Unexpectedly, the following code also does not produce an SC2164 warning:

#!/usr/bin/env -S bash -o foobared
cd foo

It seems that the letter "e" in -o foobared (as well as any lowercase "e" after env -S bash) disables the SC2164 warning. When the letter "e" is removed from -o foobared, the code does produce an SC2164 warning:

#!/usr/bin/env -S bash -o foobard
cd foo

Does ShellCheck not fully support env -S?

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