On Fri, Feb 08, 2019 at 04:56:12PM -0500, pmkellly(a)frontier.com wrote:
looks like a shebang is a way to make hard path
reference to an executable like bash. Is this right or have I missed
something?
You missed something. Samuel Sieb already replied with
reference. You may use it like
#!/usr/bin/env bash
which will look for bash in your PATH and similar with
other interpreters.
I thought people were trying to get hard coded paths out of their
code.
Usually you DO NOT want to execute a program called
'bash' found somewhere instead of /bin/bash. A script writer does not
control what will be found first in PATH.
Besides in the above you need '#!/usr/bin/env' as kernel knows nothing
about PATH. You can more often encounter '#!/usr/bin/env python'
or something like that; this give more flexibility which 'python'
to use with trade-offs involved.
Michal