Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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".
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 ?
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.