Is there a way to set up bash so that it executes any file with a .sh extension, say for example mycommand.sh, just by typing mycommand, in the same way that in Windows you can execute mycommand.bat just by typing mycommand?
I already used chmod +x and put the directory containing mycommand.sh in the PATH, so no need to state those things.
An obvious way would be to rename mycommand.sh to mycommand. I don't want to do this. Some third-party products (e.g. Kafka, and some database systems) provide shell scripts which all have a .sh extension and I don't want to be renaming things I don't own.
I'm specifically asking if it's possible to make .sh some kind of "known" executable extension, similar to Windows' PATHEXT environment variable.