An alternative to using #!

reg at vaxine.UUCP reg at vaxine.UUCP
Thu Mar 15 10:08:15 AEST 1984


<this line intentionally left non-blank>

     There has been an excessive amount of discussion recently about making
sure that shell scripts are "automatically" executed by the correct shell. Along
with this has gone a lot of chastising of the #! construct (which, as an aside,
I happen to think is a nice feature and not at all inconsistent with the
407/410/413 magic number stuff exec(2) already did).  If you are *really* upset
with using #! or are worried that it won't work on every system, here is what
you do:

        exec /bin/my-own-personal-shell-and-the-hell-with-everyone-else <<EOF
        <my shell file goes here>
        EOF

I believe you will find the "exec" intrinsic in both the Bourne shell and the C
shell.  (I don't know (nor care, but that is beside the point) about the Korn
shell.)

     Can we change the topic, now that we have beaten this dead horse into
sub-atomic particles?

                                                Rick Genter
                                                Automatix Inc.
                                                linus!vaxine!reg



More information about the Comp.unix.wizards mailing list