0

I have the directory /data/bin and in my home directory is symlink /home/myuser/bin -> /data/bin

I have set PATH into the /home/myuser/bin/ When /home/myuser/bin is the directory, the PATH works fine, when /home/myuser/bin is symlink PATH is not working. (Working means that I can run script in this path).

How to setup PATH for symlink?

The same in bash (5.0.7) and tcsh on the Fedora30.

bash example:

$ pwd
/home/myuser
$ ls -ld bin
lrwxrwxrwx. 1 myuser myuser 17 22. zář 07.22 bin -> /data/LHData/bin/
$ echo $PATH
/home/myuser/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin
  • Does your user actually have access to /data/LHData/bin? – Kusalananda Oct 4 '19 at 8:09
  • Yes, when I add /data/LHData/bin into the PATH variable, PATH is working – perLHawk Oct 5 '19 at 11:35
0

The problem is solved. Explanation:

The /data disk is encrypted. When the computer is booted up, first I must open encrypted disc from the terminal. When the /data disk is open, the PATH not works even the /data/LHData/bin is readable now! I must run rehash or quit terminal and open again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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