file attributes

Jamie Mason jmason2 at gpu.utcs.utoronto.ca
Thu Jun 20 12:17:49 AEST 1991


	No.  You don't need a new system call.  exec() does just fine.
You just need smarter applications.

	Unix already has the facility you mention.  Let's say you have a
shell script.  You want it to be run by the Bourne shell.  So you put as
the first line:
#!/bin/sh

	Let's say you have a mailbox, and you want it to be read by
/usr/ucb/mail.  You put as the first line:
#!/usr/ucb/mail -f

	Then you chmod them to be executable.  When you exec() them, the
Kernel gets the message, and starts the right program.

	Unfortunately, in the second case, Mail does not understand what
the #! is doing at the begining of its file, and it gets pissed off.
Mush, on the other hand, quietly ignores it, and works fine.  Mush,
however, does not write this line back out at the beginning of the file,
so you end up with an executable file with no #!.

	So you see, we *don't* need a new system call, we just need
utilties which consider an initial #! line to be sacred.  It is ignored
on input, even if # is NOT a comment character, and it is rewritten
intact on output.

	Mail programs might even GENERATE a #! with their own name when
they write NEW mailboxes, etc...

	*Please* don't bloat the kernel with features that belong in
user mode.

Jamie  ...  Lurker in the Process Table
Written On  Wednesday, June 19, 1991  at  10:14:52pm EDT



More information about the Comp.unix.wizards mailing list