LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-30-2010, 06:40 PM   #1
nasridine
Member
 
Registered: Jan 2010
Posts: 52

Rep: Reputation: 15
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?
 
Old 06-30-2010, 06:52 PM   #2
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

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

Last edited by sycamorex; 07-01-2010 at 04:17 PM.
 
Old 06-30-2010, 08:02 PM   #3
shahkent
LQ Newbie
 
Registered: Aug 2009
Posts: 13

Rep: Reputation: 1
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.
 
Old 06-30-2010, 08:52 PM   #4
Kenhelm
Member
 
Registered: Mar 2008
Location: N. W. England
Distribution: Mandriva
Posts: 359

Rep: Reputation: 170Reputation: 170
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
 
Old 06-30-2010, 11:43 PM   #5
nasridine
Member
 
Registered: Jan 2010
Posts: 52

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by shahkent View Post
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
 
Old 07-01-2010, 03:37 PM   #6
shahkent
LQ Newbie
 
Registered: Aug 2009
Posts: 13

Rep: Reputation: 1
Smile

Quote:
Originally Posted by nasridine View Post
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.
 
  


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
mkdir : cannot create directory : no such file or directory patcheezy Linux - Newbie 6 05-13-2009 11:26 AM
Copying a single file into each directory of a directory tree mlapl1 Linux - Newbie 2 06-27-2007 10:18 PM
How to untar a file in another directory other then current directory. dr_zayus69 Linux - Software 8 05-16-2007 11:01 AM
How to protect a file/directory in your home login directory (RH Linux) jitsenho Linux - Security 9 07-03-2006 11:08 PM
awk: fatal:cannot open file for reading (no such file or Directory) in Linux sangati vishwanath Linux - Software 4 07-06-2005 12:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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