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

Add missing shebang (#!) lines #183

Merged
merged 1 commit into from
Nov 2, 2024

Conversation

larsks
Copy link
Contributor

@larsks larsks commented Nov 2, 2024

Executable shell scripts should always start with a shebang line
(#!/path/to/shell) specifying which interpreter to use for the script. This
ensures, for example, that in Debian/Ubuntu environments, scripts that
expect Bash semantics are actually using Bash rather than /bin/sh.

Scripts that are missing a shebang line will also fail to execute when
executed directly (rather than via a shell):

>>> import os
>>> os.execve('./test.sh', ['test.sh'], {})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 8] Exec format error: './test.sh'

Executable shell scripts should always start with a shebang line
(#!/path/to/shell) specifying which interpreter to use for the script. This
ensures, for example, that in Debian/Ubuntu environments, scripts that
expect Bash semantics are actually using Bash rather than `/bin/sh`.

Scripts that are missing a shebang line will also fail to execute when
executed directly (rather than via a shell):

    >>> import os
    >>> os.execve('./test.sh', ['test.sh'], {})
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    OSError: [Errno 8] Exec format error: './test.sh'
@larsks larsks merged commit 5b6a5cf into nerc-project:main Nov 2, 2024
4 checks passed
@larsks larsks deleted the fix/missing-shebang branch November 2, 2024 14:10
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

Successfully merging this pull request may close these issues.

2 participants