[Thread Prev][Thread Next][Thread Index]
Re: Path to Perl
- To: pilotmgr@xxxxxxxxxxxxxxxxxxxxx, Jim.Koelkebeck@East
- Subject: Re: Path to Perl
- From: Victor Galis <victorg@xxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 14 May 1998 13:21:27 -0700 (PDT)
- Cc: Alan.Harder@Corp
- Reply-to: Victor Galis <victorg@xxxxxxxxxxxxxxxxxxxx>
Why not use which
which perl
it returns the path to perl in your environment.
Vic
Date: Thu, 14 May 1998 14:57:11 -0400
From: Jim Koelkebeck <Jim.Koelkebeck@East>
To: Pilot Manager Discussion <pilotmgr@xxxxxxxxxxxxxxxxxxxxx>
CC: Alan Harder <Alan.Harder@Corp>
Subject: Re: Path to Perl
Content-Transfer-Encoding: 7bit
Alan Harder wrote:
>
> ouch. resisting urge to flame.
>
> > When I ran setup it insisted on finding Perl in /usr/dist instead of in
> > /opt/PERL even though the new version was at the front of my PATH.
> > I got around it by umounting /usr/dist. Wouldn't it be nice if it used the
> > PATH to find Perl instead of just assuming that if there's Perl in
/usr/dist,
> > that's the one to use.
>
> yes, wouldn't it be nice.. wait a minute! it is!
>
> echo "Locating Perl 5..."
> for cmd in perl5 perl
> do
> for dir in `echo $PATH | sed -e 's/:/ /g'`
> do
>
> As you can see it is checking your PATH and there is no hardcoded
"/usr/dist".
> However, it looks for "perl5" before just "perl". This could be your
problem.
> Do you have /opt/PERL/perl5?
> /usr/dist/exe/perl5 exists which is why it finds it first.
In the context of the brief code segment, why not replace it with:
for dir in `echo $PATH | sed -e 's/:/ /g'`
do
for cmd in perl5 perl
do
This would find the first occurance in your path of either perl5 or
perl,
v. "first, find perl5, then (if needed) find perl, in your path".
------------------------------------------------------------------------
***********************************************************
* This is a public mailing list! *
* Please do not publish Sun proprietary information here! *
* - - - - - - - - - - - - - - *
* http://www.moshpit.org/pilotmgr *
***********************************************************
______
/_____/\
/____ \\ \ Victor Galis
/_____\ \\ / Development Mgr. - SMCC IR
/_____/ \/ / / Sun Microsystems Computer Company
/_____/ / \//\ Mail Stop UPAL01 - 348
\_____\//\ / / 901 San Antonio Road
\_____/ / /\ / Palo Alto, CA 94303
\_____/ \\ \ Phone: (650) 336-0310
\_____\ \\ victor.galis@xxxxxxx
\_____\/
|
|