Subject: Re: Changing exec's #! behavior
To: Robert Elz <kre@munnari.OZ.AU>
From: Andrew Brown <>
List: tech-kern
Date: 06/15/2000 16:59:11
>But I also wanted to be able to do (and can still do on NetBSD) ...
>	#!/usr/bin/awk NR > 1 {print $1}
>which (as a one line file) works just fine as a "print column 1" program,
>which is perhaps pretty silly (col works better usually), but {print $1 + $2}
>is something that is harder other ways.

that's a neat use of this "function" but imho, it's not that much of a
feature and looks more like a bug.  what do the standards say?  perl
obviously expects the interpreter to *only* pass one arg, as do many
other things.  i particularly like being able to:

    #!/bin/sh - # -*-Lisp-*-

and get lisp mode when i'm using emacs.

>ps: to whoever asked for #! to be able to refer to another #! script,
>that wasn't done because dealing with recursive #! scripts would have been
>a true pain to deal with, and I suspect, still would be (that is a script,
>which directly or indirectly, attempts to run itself).

that was me...and i figured that the symlink loop protection mechanism
would be applicable in a similar way to this.

|-----< "CODE WARRIOR" >-----|             * "ah!  i see you have the internet (Andrew Brown)                that goes *ping*!"       * "information is power -- share the wealth."