[mdlug] I need a script Hero
Aaron Kulkis
akulkis3 at hotpop.com
Thu Feb 1 16:20:54 EST 2007
Raymond McLaughlin wrote:
> Wojtak, Greg wrote:
>>> On 2/1/07, Aaron Kulkis <akulkis3 at hotpop.com> wrote:
>>>>>> sh setup.sh
>>>> ^^
>>>> EWWWWWWWW ... never got DOS out of your head, have you...
>>>> Just call it 'setup' like normal Unix and Linux users...
>>>> SHEESH!
>
>> I see nothing wrong with using an extension to denote what the file is. I
>> use .sh and .bin quite frequently to remind myself at a glance that this
>> file is indeed a shell script or a binary so I don't accidentally vi a
>> binary in a feeble attempt to see what it's doing. Besides, if this was
>> DOS, it would be called INSTALL.BAT, not setup.sh!
>>
>
> I agree that file extensions, while optional, are often a good option.
But not on scripts that are meant to be commands....
> It's also good that the OS doesn't completely rely on the extension. For
> example if you rename pic.jpg to pic.gif or even just pic, most linux
> programs will know what to do while Windows will be clueless.
>
> I have a vague recollection of seeing some advertising ay one time,
> possibly MS, proclaiming "Say good bye to 'Magic Numbers'!" It seemed
> like a good thing then, not so now.
Yes...magic numbers are part of a DEFINED DATA SYNTAX of the file contents,
and are not easily mangled by unwitting users.
Filename extensions, on the other hand, should really only be used
for files associated with compilers (source files, non-executable
object files, and libraries).
More information about the mdlug
mailing list