LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-03-2003, 08:57 AM   #1
ndha
LQ Newbie
 
Registered: Jun 2003
Posts: 8

Rep: Reputation: 0
How to change the path of the current directory ?


Sorry if my subject title is not clear .

I am using a Red hat 9.0. As everybody may know, when we are in a directory, say mydir,
if we want to run an executable file "test" in mydir, we type:
./test (enter)

It works ok for me but now, the executable file I run has a call to invoke another executable
file namely test2. However, this call doesn't use the "./" path, i.e just "test2" so it causes an error (command not found) although test2 is really in mydir. I couldn't change this because "test " is a binary file and there is no way to modify it. (it's not a shell script).

I want to find how I can change the configuration of the system so that if I am in "mydir" and want run an executable file "test", I have to use the command "test" instead of "./test".

Please help me if you can.
Thanks in advance.

Ha.
 
Old 12-03-2003, 09:06 AM   #2
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963

Rep: Reputation: 32
what do you mean ?

you want to move around or run a program from a dir..

tommytomato
 
Old 12-03-2003, 09:39 AM   #3
ndha
LQ Newbie
 
Registered: Jun 2003
Posts: 8

Original Poster
Rep: Reputation: 0
Ok, let me explain my problem in another way.
I am inside the directory "mydir", so it is my current directory. In "mydir", there are two executable files, namely "test" and "test2". "test" has a call to "test2". "test" is a binary file and I can't modify it.

When I run "test", I got an error (test2: command not found) and I know it is because the command to invoke "test2" in "test" source code is "test2" instead of "./test2".

I can't modify "test". How to get rid of this problem ?

Ha.
 
Old 12-03-2003, 10:00 AM   #4
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963

Rep: Reputation: 32
I can't modify "test". How to get rid of this problem ? delete it lol

nar, are you trying to install a program and its looking for extra files ???

are you getting dependency errors ???

just trying to understand what your doing

tommytomato
 
Old 12-03-2003, 10:09 AM   #5
ndha
LQ Newbie
 
Registered: Jun 2003
Posts: 8

Original Poster
Rep: Reputation: 0
No, it's not the problem with installation or sth like that.

I have to executable files, "test" and "test2" where "test" has a call to invoke "test2" to run. I am quite sure that I have "test2" in the same directory with "test".

Normally, in Red hat, if we want to run an executable file in the current directory, we have to type: ./test . Please notice the path "./"

I know this is reason of my problem. The command to call "test2" inside "test" does not include the path "./" . It works ok with Debian but it is not the case with Red hat, where we have to include path "./" if we want to run any executable file in the current directory. I don't know whether I can change that rule. If I can do so, I can fix my problem.

Thanks for your attention.
Ha.
 
Old 12-03-2003, 10:15 AM   #6
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963

Rep: Reputation: 32
i see , sounds like your having fun.

wouldn't have any thing to do with linking it , would it.

my mate just left, he may know i'll ask him later, hes pretty good with linux

tommytomato
 
Old 12-03-2003, 10:21 AM   #7
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Just add your home directory or the directory its located in to your $PATH or adjust your program or script with the full path to both. This is asked quite often, a search most likely will find you other solutions or more details of what I've explained you need to do.
 
Old 12-03-2003, 11:05 AM   #8
ndha
LQ Newbie
 
Registered: Jun 2003
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks a lot. I got it.

Ha.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mozilla Directory Path Change: go_sooner Linux - Software 4 06-11-2005 01:21 AM
How to rsynce the actual directory path instead of just the directory at the end of Niceman2005 Linux - General 5 04-08-2005 07:58 PM
change profile to show current directory jpolachak Linux - Newbie 2 01-20-2005 07:36 PM
setting bash to look in current directory before searching the path muhkuhmasta Linux - Newbie 4 09-21-2004 02:08 AM
edit path environment variable to include current working directory alb1954 Linux - Newbie 8 07-11-2004 11:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:55 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