Same reason you don't put extensions on other commands. On linux systems, the command to list files is usually an ELF binary; but it's still named ls, not ls.elf, because the user running doesn't care or doesn't need to know what language was used to implement the command.
And what if you wrote a command, using sh, and named it foo.sh, but later realized it should rather be written in perl, then you have a problem. Do you keep the name as is, having now a perl script with a misleading .sh extension? or do you rename it to foo.pl and break everything that were relying on foo.sh?
I use extensions on the actual scripts because I have a wide variety of languages that I use (bash, python, js, etc.). Most are in their own directory under ~/scripts/[insert language]/, but some are not (they are older than my "filing system" itself). Anything that I use a lot has a symlink in my ~/bin folder without the extension. So if I change languages for the command (which I have done before) I only need to change what the symlink points to. I also have one that will check all of my symlinks to make sure they are not dead links (they never are).
5
u/geirha Dec 02 '14
Don't put extensions on scripts. Especially not
.shwhen the script isn't even an sh script.