executable LaunchDaemons plist

Vincent Lefevre vincent-opdarw at vinc17.org
Wed Jan 27 05:04:44 PST 2010


On 2010-01-26 22:42:00 -0800, Michael Crawford wrote:
> Just for grins I just tried the following on Ubuntu:
> 
> $ cat runme.plist
> <xml>
> <foo>
> <bar>This is some text</bar>
> <baz boo="This is an attribute value">But this isn't</baz>
> </foo>
> 
> $ chmod +x runme.plist
> $ ./runme.plist
> ./runme.plist: line 1: syntax error near unexpected token `newline'
> ./runme.plist: line 1: `<xml>'
> 
> I would expect Mac OS X to complain in a similar way.

Yes, fortunately, XML files trigger a syntax error very early.
In the past, I ran a text file (incorrectly marked as executable)
by mistake because of completion, and many files where created
because of a ">" character in many lines.

> So my guess is that if an executable doesn't start out with one of the
> well-known machine code Magic Numbers, and it doesn't start out with
> Pound-Sign Bang Path Name, then the kernel just assumes it's a Bourne
> Shell script.

Yes, and I hate this useless feature.

-- 
Vincent Lefèvre <vincent at vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)


More information about the macports-dev mailing list