In Unix-like operating systems, if you want to execute a script as as command, the script must contain a shebang line which tells the system through which scripting engine the script should be run.
For example, a simple bash script might read:
Code:
#!/bin/bash
echo "Hello, world!"
The line which reads "#!/usr/bin/bash" is the shebang line and "#!" is a shebang. This particular shebang line tells the OS that this script must be run through the command parser /bin/bash (or in other words, this is a bash script). The shebang line must be the first line of your script.
It's not like DOS, where you don't have a choice of scripting engines -- all DOS has is command.com. *nix OSes have a lot of engines available: perl, bash, zsh, ruby, etc.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.