Old-timer UN*X trivia [was Re: Error confusing a newbie]

Grant Edwards grant at nowhere.
Mon Dec 13 09:31:31 EST 1999


In article <slrn859sub.bj2.mgm at unpkhswm04.bscc.bls.com>, Mitchell Morris wrote:
>Keith Dart wrote:
>[snip]

>>In Linux, it runs with a shell! It seems Linux defaults to
>>/bin/sh if an executable text file is executed even without a
>>#! as the "magic" number. I'm not sure if this is a bug or a
>>feature...

That's the way all of the Unix systems I've used for the past
15 years have worked.  If a file is executble, and doesn't have
a magic number, then it is assumed to be a /bin/sh script.

>As a completely off-topic aside, when did the magic number
>cease being "#! /" and turn into just "#!"?

You'd have to look at the sources for the exec system call, but
I've always understood that magic numbers were traditionally 16
bit values.

-- 
Grant Edwards                   grante             Yow!  I like your SNOOPY
                                  at               POSTER!!
                               visi.com            



More information about the Python-list mailing list