Linux-kernel mailing list archive 2000-07,: Re: #! and argv[0]: the path is removed before invoking the interpreter

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

H. Peter Anvin (hpa@transmeta.com)
16 Feb 2000 11:22:24 -0800

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Chris Meadors: "Re: Drive name slips..."
- Previous message: david parsons: "Re: Of removable devices"
- Maybe in reply to: Kevin Layer: "#! and argv[0]: the path is removed before invoking the interpreter"
- Next in thread: Ahmon Dancy: "Re: #! and argv[0]: the path is removed before invoking the interpreter"

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/

- Next message: Chris Meadors: "Re: Drive name slips..."
- Previous message: david parsons: "Re: Of removable devices"
- Maybe in reply to: Kevin Layer: "#! and argv[0]: the path is removed before invoking the interpreter"
- Next in thread: Ahmon Dancy: "Re: #! and argv[0]: the path is removed before invoking the interpreter"