javalib-team / sawja

Sawja provides a high level representation of Java bytecode programs and static analysis tools.
GNU General Public License v3.0
11 stars 4 forks source link

Could you please use '#!/usr/bin/env bash' as the shebang line for Bash scripts? #5

Closed yesudeep closed 2 years ago

yesudeep commented 2 years ago

The build for sawja fails on several operating systems because GNU Bash is not guaranteed to be located at /bin/bash.

Here's a summary of why I'd request you to use #!/usr/bin/env bash instead:


|--------------------+--------------------------------------------------------------|
| Operating system   | GNU Bash binary location                                     |
|--------------------+--------------------------------------------------------------|
| Darwin (MacOS)     | ~/usr/local/bin/bash~                                        |
| DragonFlyBSD       | ~/usr/local/bin/bash~                                        |
| FreeBSD            | ~/usr/local/bin/bash~                                        |
| GNU/Linux (Alpine) | ~/bin/bash~                                                  |
| GNU/Linux (Arch)   | ~/usr/bin/bash~                                              |
| GNU/Linux (Guix)   | ~/run/current-system/profile/bin/bash~                       |
| Haiku              | ~/bin/bash~                                                  |
| NetBSD             | ~/usr/pkg/bin/bash~                                          |
| OpenBSD            | ~/usr/local/bin/bash~                                        |
| Solaris (OmniOS)   | ~/usr/bin/bash~                                              |
| Windows            | ~C:\Windows\System32\bash.exe~                               |
| Windows (MSYS2)    | ~/usr/bin/bash~                                              |
| Windows (Scoop)    | ~C:\Users\$USER\scoop\apps\msys2\<version>\usr\bin\bash.exe~ |
|--------------------+--------------------------------------------------------------|

Example:

https://github.com/javalib-team/sawja/blob/master/configure.sh#L1

Thank you! :)

davidpichardie commented 2 years ago

Thanks again for you help