From mboxrd@z Thu Jan 1 00:00:00 1970 From: arnold@skeeve.com (arnold@skeeve.com) Date: Sat, 10 Sep 2016 13:22:48 -0600 Subject: [TUHS] Shell control through external commands In-Reply-To: <20160910174011.GF5970@dnied%tiscali.it> References: <201607151647.u6FGlqvW037575@tahoe.cs.Dartmouth.EDU> <20160910174011.GF5970@dnied%tiscali.it> Message-ID: <201609101922.u8AJMmtq024477@freefriends.org> Dario Niedermann wrote: > I never knew that a shell script could work without a shebang line. That was the simplicity of the original system, where you just made the file executable. The shell would fork and exec as usual. When the exec failed, the shell noticed that errno was ENOEXEC (not a runnable file) and started interpreting the script itself. This broke down as soon as there were two shells (/bin/sh and csh) since if you tried to run a csh script from the Bourne shell or vice versa, things weirded out pretty quickly. IIRC #! originated at Bell Labs but it got out to the world via BSD. Perhaps Dr. McIlroy could confirm / deny / expand upon the details (please?) Thanks, Arnold