Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Re(3) shebang line

by riffraff (Pilgrim)
on Jan 04, 2002 at 04:56 UTC ( [id://136168]=note: print w/replies, xml ) Need Help??


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...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://136168]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (2)
As of 2024-04-19 21:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found