On Tue, Feb 13, 2024 at 2:27 PM Chet Ramey <chet.ramey@case.edu
<mailto:chet.ramey@case.edu>> wrote:
This is a comment from the code as it existed in July 1989:
/* Hopefully this command is defined in a disk file somewhere.
1) fork ()
2) connect pipes
3) close file descriptors 3-NOFILE
4) look up the command
5) do redirections
6) execve ()
7) If the execve failed, see if the file has executable mode
set.
If so, and it isn't a directory, then execute its contents as
a shell script.
Note that the filename hashing stuff has to take place up here,
in the parent. This is probably why the Bourne style shells
don't handle it, since that would require them to go through
this gnarly hair, for no good reason.
*/
It persists in the source to this day (except for the closing files bit).
Pardon my ignorance, but I don't understand how that relates to when the
redirection filename argument gets parsed, specifically.