LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   No such file or directory (https://www.linuxquestions.org/questions/linux-newbie-8/no-such-file-or-directory-817260/)

nasridine 06-30-2010 06:40 PM

No such file or directory
 
I copied g95 executable under /usr/bin which is clearly in my PATH. When I type g95, it says "bash: /home/username/bin/g95: No such file or directory". Why doesn't it look for somewhere else that is in my PATH?

sycamorex 06-30-2010 06:52 PM

EDIT: Sorry, disregard my post previous post. Obviously it's got nothing to do with your problem. I answered without reading it properly.

shahkent 06-30-2010 08:02 PM

It's possible that '/home/username/bin/g95' is hard-coded in the g95 binary. If it is, this might do the trick:

cd /home/username/bin
ln -s /usr/bin/g95 g95

This will create a soft-link in the /home/username/bin directory to the g95 binary installed in the /usr/bin directory.

Now, try to run g95 and see if this did the trick.

Good luck.

Shahriar.

Kenhelm 06-30-2010 08:52 PM

Your shell might have hashed the location of the file and so could be expecting to find it in its original position.
'hash' is a bash builtin. As the shell finds commands along the search path it remembers the found location in an internal hash table. The next time you enter a command the shell uses the value in its hash table instead of searching the path again.
Code:

# To see your 'hash' table:-
hash

# If 'g95' is on the hash table you can remove it with:-
hash -d g95


nasridine 06-30-2010 11:43 PM

Quote:

Originally Posted by shahkent (Post 4019907)
It's possible that '/home/username/bin/g95' is hard-coded in the g95 binary. If it is, this might do the trick:

cd /home/username/bin
ln -s /usr/bin/g95 g95

This will create a soft-link in the /home/username/bin directory to the g95 binary installed in the /usr/bin directory.

Now, try to run g95 and see if this did the trick.

Good luck.

Shahriar.

I guess I didn't give it an absolute path when I created the g95 link. Maybe that's why the link was highlighted red. Thanks

shahkent 07-01-2010 03:37 PM

Quote:

Originally Posted by nasridine (Post 4020082)
I guess I didn't give it an absolute path when I created the g95 link. Maybe that's why the link was highlighted red. Thanks

Yep. That's it exactly.


All times are GMT -5. The time now is 10:48 PM.