On Fri, 06 Aug 2004 16:42:12 -0600, Michael L Torrie
<[EMAIL PROTECTED]> wrote:
> On Fri, 2004-08-06 at 17:57, [EMAIL PROTECTED] wrote:
> > How come the following script deletes itself?
> >
> > #!/bin/rm
>  ^^^^^^^^^^^^
> Standard #! behavior.  Your little file isn't a script at all because
> you specified rm as the shell script processing command, which of course
> rm is not.  Whenever the kernel sees an executable file with a #! as the
> first line, it then takes the remaining part of that line as the command
> to execute and feeds it as the first argument, followed by any arguments
> you passed the script.

This is interesting to me now that you mention it.  It seems that
rather than pass the name of the file to the #! thingy it could have
passed the contents of the file.  I guess what I'm saying is that
while, yes, that is how it is, it didn't have to be.  What advantages
does this approach have over the other?

____________________
BYU Unix Users Group 
http://uug.byu.edu/ 
___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to