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 #!/bin/bash shebang to scripts #65

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

chmeliik
Copy link
Member

When I run ./generate.sh, my machine executes the script via /bin/sh. And yes, /bin/sh is a symlink to /bin/bash. However! As seen in the bash manpage, or in https://tiswww.case.edu/php/chet/bash/POSIX:

When invoked as 'sh', Bash enters POSIX mode after reading the
startup files.

Item 15. in POSIX mode:

Function names must be valid shell 'name's.  That is, they may not
contain characters other than letters, digits, and underscores, and
may not start with a digit.  Declaring a function with an invalid
name causes a fatal syntax error in non-interactive shells.

This causes scripts/update-tekton-definition to fail on

function add-backstage-labels () { ... }

Add explicit #!/bin/bash shebang to all scripts to avoid POSIX/non-POSIX issues.

When I run ./generate.sh, my machine executes the script via /bin/sh.
And yes, /bin/sh is a symlink to /bin/bash. However! As seen in the bash
manpage, or in https://tiswww.case.edu/php/chet/bash/POSIX:

    When invoked as 'sh', Bash enters POSIX mode after reading the
    startup files.

Item 15. in POSIX mode:

    Function names must be valid shell 'name's.  That is, they may not
    contain characters other than letters, digits, and underscores, and
    may not start with a digit.  Declaring a function with an invalid
    name causes a fatal syntax error in non-interactive shells.

This causes scripts/update-tekton-definition to fail on

    function add-backstage-labels () { ... }

Add explicit #!/bin/bash shebang to all scripts to avoid POSIX/non-POSIX
issues.

Signed-off-by: Adam Cmiel <acmiel@redhat.com>
@yangcao77 yangcao77 merged commit ee860ad into redhat-appstudio:main Jul 31, 2024
3 checks passed
Copy link

@chmeliik chmeliik deleted the add-shebang branch July 31, 2024 15:09
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