"#!" scripts, kernel patches, and Xenix

Ross Oliver rosso at sco.COM
Mon Sep 12 18:23:06 AEST 1988


In article <161 at tessera.UUCP> jtc at tessera.UUCP (J.T. Conklin) writes:
>Has anyone patched the kernel exec routine to execute interpreter
>files ("#!" scripts)?

The exec() function executes binaries only.  If exec() fails (which
it does on a shell script), then it is up to your shell to decide
what to do.  The Bourne shell then executes "sh <file>"  The C shell
will look at the first line, and if it starts with "#!", csh executes
the script as "csh <file>", otherwise, it uses "sh <file>"  The
Bourne shell, of course, assumes everything that is not a binary is
a Bourne shell script.

Ross Oliver
SCO Technical Support
uunet!sco!rosso



More information about the Comp.unix.xenix mailing list