3 ms·
That's completely incorrect. Where did you get that information from? A regular POSIX shell will simply call the `exec` syscall on the path provided. It may se
by slabity 4y ago
That's completely incorrect. Where did you get that information from?
A regular POSIX shell will simply call the `exec` syscall on the path provided. It may set up some environment variables or parse some arguments, but it will not actually read the file. In fact you can have a file with executable permissions, but not read permissions.
The kernel determines how to execute the file based on its Magic Numbers, which are the first few bytes in certain file formats that will specify what type of file it is. It just so happens that the one for scripts are `#!`.