On 15-12-2005 09:27:50 +0100, Dirk Schönberger wrote:
> > Is it really possible to find any executable without path resolution?
> > Only ./myapp doesn't require the shell to use the $PATH variable, but
> > does use the current (absolute) path ($CWD) in order to start the myapp
> > binary.
> 
> You still can do an explicit /usr/bin/wc

Eh yeah?  I didn't understand your initial comment.  Your absolute
example is equal to my ./ example.

> > Using "#!/usr/bin/env perl" in a script instead of "#!/usr/bin/perl"
> > allows perl to be in any location in the path environment.
> >
> 
> I am not really interested in finding perl, but instead the executable I
> want to call (/usr/bin/wc in this case)

/usr/bin/env wc

> Besides, if I do a "#!/usr/bin/env perl", I may find the MacOSX provided
> Perl, not the Perl I installed via Gentoo.
> Somehow defeats the purpose, doesn't it?

Not really, because /usr/bin/env does a path resolution.  This means
that the first binary it finds that matches is executed, like a shell
does that.  If you setup your paths appropriately, scripts don't need to
know where wc, perl, awk or whatever exactly remain.


-- 
Fabian Groffen
Gentoo for Mac OS X Project -- Interim Lead
-- 
[email protected] mailing list

Reply via email to