3 ms·
More precisely: - The shell finds opens up the file you want to execute - It gets the first line of the file - It figures out what program to execute
by kovek 10y ago
More precisely:
- The shell finds opens up the file you want to execute
- It gets the first line of the file
- It figures out what program to execute
- It calls fork()
- In the new process, it executes the program (using exec()) and passes the file as the input to the program.
- Tyr42 10y agoThe shell is not involved in looking at the first line of the program, that's what happens in `exec`.