I have made Bash scripts before and they all ran fine without this at the beginning. What's the point of putting it in? Would things be any different?
Also, how do you pronounce #
? I know that !
is pronounced as "bang."
How is #!
pronounced?
I have made Bash scripts before and they all ran fine without this at the beginning. What's the point of putting it in? Would things be any different?
Also, how do you pronounce #
? I know that !
is pronounced as "bang."
How is #!
pronounced?
It is called a shebang. It consists of a number sign and an exclamation point character (#!), followed by the full path to the interpreter such as /bin/bash. All scripts under UNIX and Linux execute using the interpreter specified on a first line.
It can be useful to someone that uses a different system that does not have that library readily available. If that is not declared and you have some functions in your script that are not supported by that system, you should declare #/bin/bash. I've ran into this problem before at work and now I just include it as a practice.