Skip to content

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

@hzeller

Description

@hzeller

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions