Re: #! and argv[0]: the path is removed before invoking the interpreter

From: H. Peter Anvin (hpa@transmeta.com)
Date: Wed Feb 16 2000 - 14:22:24 EST


Followup to: <200002161849.KAA22598@ultra.franz.com>
By author: Kevin Layer <layer@franz.com>
In newsgroup: linux.dev.kernel
>
> I have an interpreter of #! scripts that absolutely needs to know the
> full path of where the executable is, and I can't assume it will be in
> the user's path. Getting it in argv[0] is the cleanest way. That is,
> I can tell users they have to use the full path in the #!, if they
> want to use my interpreter.
>
> I believe the behavior of #! on Solaris goes all the way back to BSD
> in of the early 80's. FreeBSD 3.0 behaves as Solaris does.
>
> I hope this considered a bug. If there willingness to take a patch for
> it, I might work on making the fix.
>

Read it out of the first line of the script! #! doesn't interpret the
PATH.

        -hpa

-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Feb 23 2000 - 21:00:16 EST