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

Does ShellCheck not fully support env -S? #3123

Open
scalisi opened this issue Jan 16, 2025 · 0 comments
Open

Does ShellCheck not fully support env -S? #3123

scalisi opened this issue Jan 16, 2025 · 0 comments

Comments

@scalisi
Copy link

scalisi commented Jan 16, 2025

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?

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

No branches or pull requests

1 participant