Mar 3, 2009, 6:52 AM
Post #6 of 6
Just to summarize.
The "shebang" is a line at the top of an executable script that starts with the characters "#!".
What comes after is supposed to be the path to the program that should be used to execute the script (e.g. "/usr/bin/perl", "/bin/bash", etc.).
Only L/Unix systems (and cygwin on windows) look at the shebang.
Windows uses a different system : On Windows, the operating system associates file extensions with executable programs (e.g. ".pl" --> perl.exe). The associations between extensions and executing programs are stored in the Windows registry.
The goal in both cases is to obviate having to type "perl " at the beginning of each command line (or, on GUI systems, having the system ask you what you want to do when you double-click on a file).
Kinda obsolete at this point, but hey! It's tradition.