Re: Choosing the path based on the system "uname" command



doni <doni.sekar@xxxxxxxxx> wrote:

I want to write a program that does check the appropriate system path
for perl in FreeBSD and Linux.

Why?

The path where I have it in FreeBSD is
#! /usr/local/bin/perl

Look for other links:

% which perl
/usr/bin/perl

% uname -smr
FreeBSD 6.2-STABLE i386

If you installed Perl from ports, /usr/bin/perl should be there.

I wanted the program to check for the uname of the system and choose
the appropriate path.

Not a good way to check, since it could be anywhere. which or whereis
would be better.

Can anyone tell me how can I have my program
check this.

chomp(my $perlpath = `which perl`);
print "path to perl is $perlpath\n";

--
Warren Block * Rapid City, South Dakota * USA
.



Relevant Pages