Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am having problems with symbolic links and the $PATH variable.

I have a directory:

# /usr/rulerX/square

where /usr/rulerX/square is a symbolic link such that:

# ls -la
square --> square.hg.current

My path variable is set as:

# echo $PATH
/usr/rulerX/square/bin:/usr/local/bin:/usr/bin

I have a file, runSquare, under /usr/rulerX/square.hg.current/bin/

Here's the problem:

# runSquare
runSquare: Command Not Found

What gives? If I set /usr/rulerX/square.hg.current/bin to the PATH; everything works fine. However, if I have the symbolic link (just 'square'), it can't find the file.

  • I am using CentOS with csh
share|improve this question

migrated from stackoverflow.com Sep 18 '10 at 12:25

This question came from our site for professional and enthusiast programmers.

    
setenv PATH /usr/rulerX/square/bin:$PATH will NOT allow me to execute. –  Carlo del Mundo Sep 17 '10 at 15:32
    
setenv PATH /usr/rulerX/square.hg.current/bin:$PATH however WILL allow me. What's the matter here? –  Carlo del Mundo Sep 17 '10 at 15:33
    
It is good idea to avoid running as root as much as possible. Consider sticking to an unprivileged account and using sudo on those operation that require elevated privilege. –  dmckee Sep 17 '10 at 15:48

2 Answers 2

Some shells (including csh and derivatives) maintain a preprocessed list of files in the directories along PATH to increase searching speed. If your shell is doing that you need to instruct it to rebuild the list.

Typically there is a shell built-in for this, and it is often called rehash.

share|improve this answer

Nevermind; it appears that after a few minutes; the $PATH to /bin/ propagated to the symbolic link.

It could be a bug?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.