lkml.org 
[lkml]   [2000]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: #! and argv[0]: the path is removed before invoking the interpreter
Date
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/

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.081 / U:0.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site