LWN.net Logo

making .desktop files executable

making .desktop files executable

Posted Feb 13, 2009 10:02 UTC (Fri) by dlang (✭ supporter ✭, #313)
In reply to: making .desktop files executable by DeletedUser32991
Parent article: Follow up: How to write a Linux virus

umm, since lines that start with # are comments, adding a #! line to the top of the file would not make them non-complient.

# indicates comments in bash, perl, and many other scripting languages. they all cope quite nicely with #! in the first line (by having the interpreter executing the file ignore it)

at that point the desktop files could be executables in any language. they no longer need to be their own special thing.

on *nix you can have an executable called foo and with the #! 'magic' all you need to do is to execute it and the correct helper app is called with no ambiguity. you don't have to name things foo.pl, foo.php, foo.py, etc. (in fact naming things with extentions is likely to cause grief in the long run when you want to re-write a script in a different language, but find that everything else that calls that script includes a file extention in the name that they call)


(Log in to post comments)

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds