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:

    Under bare Ben Bulben’s head
    In Drumcliff churchyard Yeats is laid.
    An ancestor was rector there
    Long years ago, a church stands near,
    By the road an ancient cross.
    No marble, no conventional phrase;
    On limestone quarried near the spot
    By his command these words are cut:
    Cast a cold eye
    On life, on death.
    Horseman pass by!
    William Butler Yeats (1865–1939)

    The hard truth is that what may be acceptable in elite culture may not be acceptable in mass culture, that tastes which pose only innocent ethical issues as the property of a minority become corrupting when they become more established. Taste is context, and the context has changed.
    Susan Sontag (b. 1933)