D
D
Drovosek012021-04-09 13:08:51
macOS
Drovosek01, 2021-04-09 13:08:51

Difference between .command, .sh and file without extension?

Good day.
When using macOS, namely the hackintosh, you often have to execute different script files.

I noticed that all these files have the extension
either .command (for example in SSDTTime ),
or .sh (for example in ssdtPRGen ),
or no extension at all (for example, in any release of activated programs from TNT, the "Gatekeeper friendly" file is the same text file -script)

As I understand all these 3 file types are bash scripts.
I don't understand the Unix mindset, but as far as I've heard, Unix-like operating systems don't care about the file extension and which program should execute a certain file is calculated from its internal structure, not the extension.

Actually, if all the listed types of files are bash scripts and, accordingly, are executed by bash, why then they added (or, probably, it is more correct to say "exist") such extensions as .sh and .command, even if they delete the file, it will be executed in bash in the same way ?

Why do we need these extensions if everything works without them (at least on macOS)?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question