in reply to Re(3) shebang line
in thread shebang line

Mostly correct, but with some caveats.

First, when asked to execute a file, the kernel reads in the first 32 characters, minimum, not just the first two. Some of the older OS's only read the first 32 characters (POSIX spec, perhaps?), but I believe linux reads in 256. Then it checks if the first two characters if that line are #!, and if so, executes the program given by the path following the #!, up until the max characters that it read. Also, I believe it only looks at the first set of switches ('#!/usr/bin/perl -ixv' would get passed, but '#!/usr/bin/perl -i -x -v' would get passed as '#!/usr/bin/perl -i').

There's a little bit more to it, but those are the basics.

update: Disregard this. If I would have just looked around a bit, I would have noticed that everybody else basically said the same thing...