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

shebang in scripts that look like they are meant to be sourced #487

Open
hzeller opened this issue Sep 26, 2022 · 0 comments
Open

shebang in scripts that look like they are meant to be sourced #487

hzeller opened this issue Sep 26, 2022 · 0 comments

Comments

@hzeller
Copy link

hzeller commented Sep 26, 2022

While familiarizing myself with the project I noticed that there is a shell script that has a shebang, but it is not in the first line

# SPDX-License-Identifier: Apache-2.0
#!/bin/bash

This of course would not be possible to execute as the kernel expects #! as first characters in the file. So my suspicion is, that this file is actually not meant to be executed, but sourced. In that case the #! line should be removed to avoid confusion.

Similar thing with this file:

#!/bin/bash

It is not documented in the file itself, but it looks like it is always meant as setting an environment by being sourced (the name of the file itself points to that convention). That means it also should not have a #! in the front to avoid confusion.

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