LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-29-2008, 08:27 PM   #1
stabu
Member
 
Registered: Mar 2004
Location: dublin IRL
Distribution: Slackv12.1, Slamd64v12.1,Xubuntu v8.10_64, FC8_64
Posts: 438
Blog Entries: 5

Rep: Reputation: 32
as normaluser, run a different executable


Hi,

I'm a normaluser on an old Redhat machine. I'm compiling my own stuff for which I have my own private directory (available on my $PATH of course).

I've need a newer version of autoconf than is on the machine. However, having compiled it, 'which autoconf' still shows the machine's version and not mine.

I can't change the name ..., so is their anyway to give my own directory's autoconf higher priority, when called by another program?

Cheers.
 
Old 07-29-2008, 08:44 PM   #2
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
PATH determines which binary is executed when a non-relative or non-rooted command is given (eg. command contains no / chars).

Did you install the new autoconf? And if so, did you include that directory component before the directory component that contains the existing autoconf?

Eg:
PATH=/usr/local/bin:$PATH

Last edited by Mr. C.; 07-29-2008 at 08:46 PM.
 
Old 07-31-2008, 07:28 AM   #3
stabu
Member
 
Registered: Mar 2004
Location: dublin IRL
Distribution: Slackv12.1, Slamd64v12.1,Xubuntu v8.10_64, FC8_64
Posts: 438

Original Poster
Blog Entries: 5

Rep: Reputation: 32
Order matters in $PATH's allocation?

What a revelation!

I honestly did not know that. Years and years of bungling down extra directories in my PATH and sometimes not getting the results I wanted ... it's hard to believe it's taken me this long to find that out.

Mr. C: many thanks for the eye-opener!
 
Old 07-31-2008, 12:30 PM   #4
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
Absolutely matters. PATH components are tried in order.

Code:
man execvp  # search for PATH.
The exec() system call is the heart of all program executions.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot get an executable to run... disruptive Linux - Newbie 5 03-04-2008 12:18 PM
software for normaluser only stabu Linux - Software 3 02-05-2008 05:46 AM
How to run an executable from browser ??? dileepkk Programming 2 08-22-2004 04:13 AM
an executable that does not run jgoggel Programming 2 07-22-2004 08:54 PM
How do I run my executable?? scott7500 Programming 2 12-30-2001 05:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration