Filename Extension - Command Name Issues

Command Name Issues

The use of a filename extension in a command name appears occasionally, usually as a side effect of the command having been implemented as a script (in Bourne shell, Python, etc.) and the interpreter name being suffixed to the command name, a practice common on systems like Windows and Mac OS X, which rely on globally set associations between filename extension and interpreter, but sharply deprecated in UNIX-derived systems like Linux and Apple's Mac OS X, where the interpreter is normally specified as a header in the script (Shebang (Unix)).

On association-based systems, the filename extension is generally mapped to a single, system-wide selection of interpreter for that extension (such as ".py" meaning to use Python), and the command itself is runnable from the command line even if the extension is omitted (assuming appropriate setup is done). If the implementation language is changed, the command name extension is changed as well, and the OS provides a consistent API by allowing the same extension-less version of the command to be used in both cases. This method suffers somewhat from the essentially global nature of the association mapping, as well as from developers' incomplete avoidance of extensions when calling programs, and that developers can't force that avoidance. Windows is the only remaining widespread employer of this mechanism.

On systems with interpreter directives, command name extensions have no special significance, and are by standard practice not used, since the primary method to set interpreters for scripts is to start them with a single line specifying the interpreter to use (which could be viewed as a degenerate resource fork).

Developers coming from association-based culture to the interpreter directive culture often make the very distinctive error of including command name extensions. Embedding the implementation detail of the language used introduces a problem where the command's implementation language cannot be changed (for example, from shell to C++) without either breaking any tool that refers to the old script name, retaining the now inaccurate old extension, or preferably writing a wrapper in the old language that launches a tool in the new language.

Read more about this topic:  Filename Extension

Famous quotes containing the words command and/or issues:

    I had now formed a clear and settled opinion, that the people of America were well warranted to resist a claim that their fellow-subjects in the mother-country should have the entire command of their fortunes, by taxing them without their consent.
    James Boswell (1740–1795)

    How to attain sufficient clarity of thought to meet the terrifying issues now facing us, before it is too late, is ... important. Of one thing I feel reasonably sure: we can’t stop to discuss whether the table has or hasn’t legs when the house is burning down over our heads. Nor do the classics per se seem to furnish the kind of education which fits people to cope with a fast-changing civilization.
    Mary Barnett Gilson (1877–?)