Gentoo Archives: gentoo-osx

From: Grobian <grobian@g.o>
To: gentoo-osx@l.g.o
Subject: Re: [gentoo-osx] New document: Project targets
Date: Thu, 15 Dec 2005 14:29:55
Message-Id: 20051215142928.GH18161@gentoo.org
In Reply to: Re: [gentoo-osx] New document: Project targets by "Dirk Schönberger"
1 On 15-12-2005 09:27:50 +0100, Dirk Schönberger wrote:
2 > > Is it really possible to find any executable without path resolution?
3 > > Only ./myapp doesn't require the shell to use the $PATH variable, but
4 > > does use the current (absolute) path ($CWD) in order to start the myapp
5 > > binary.
6 >
7 > You still can do an explicit /usr/bin/wc
8
9 Eh yeah? I didn't understand your initial comment. Your absolute
10 example is equal to my ./ example.
11
12 > > Using "#!/usr/bin/env perl" in a script instead of "#!/usr/bin/perl"
13 > > allows perl to be in any location in the path environment.
14 > >
15 >
16 > I am not really interested in finding perl, but instead the executable I
17 > want to call (/usr/bin/wc in this case)
18
19 /usr/bin/env wc
20
21 > Besides, if I do a "#!/usr/bin/env perl", I may find the MacOSX provided
22 > Perl, not the Perl I installed via Gentoo.
23 > Somehow defeats the purpose, doesn't it?
24
25 Not really, because /usr/bin/env does a path resolution. This means
26 that the first binary it finds that matches is executed, like a shell
27 does that. If you setup your paths appropriately, scripts don't need to
28 know where wc, perl, awk or whatever exactly remain.
29
30
31 --
32 Fabian Groffen
33 Gentoo for Mac OS X Project -- Interim Lead
34 --
35 gentoo-osx@g.o mailing list