Closed nbehrnd closed 8 months ago
Thank you for introducing useful tools.
Regarding your suggestion, when referring to the purpose of the shebang, it is intended to specify the interpreter to the operating system by placing a special line at the beginning of an executable script file. In this case, since fpm.bash
is NOT intended to be an executable file itself, but rather to be source
d or loaded by the bash
shell, the #!/usr/bin/env bash
is not necessary and, in fact, should be omitted.
In practice, many script in the /usr/share/bash-completion/completions
directory (or similar directory depending on your distribution) that are part of the bash-completion
package do not have shebang line (although there are exceptions). This practice aligns with the property of scripts meant to be source
d or loaded rather than executed directly.
Thank you for indicating the difference between .sh as source vs .sh of an executable. Hence, I drop this part of the suggest.
Thank you for your suggestions.
The code improvements made by shellcheck
were incorporated into my workflow and reflected in the v0.2 release.
Thanks.
A copy-paste of file
fpm.bash
into shellcheck yields a couple of suggestions how the script can be improved further. Possibly, an additional leading line of#!/usr/bin/env bash
may be worth to consider, too.Typically I check shell scripts for the bash equally with checkbashisms. Speaking for Linux Debian, it is provided by devscripts equally available under this name for other OSes. I'm not aware if there is an interactive web site to run the tests (similar to shellcheck) without a local installation. And checkbashisms equally provides some suggestions to improve the script.