symlinking with source directory structure
Hi,
I have downloaded a utility which I have put in /opt. Now, rather than put /opt/myutil/bin/ in my PATH, I prefer to symlink from /usr/local/bin/myutility. The only problem I get is that the utility looks for files relative to where it has been launched from, so in this case it is /usr/local/bin rather than /opt/myutil/bin. Is there any way I can get the symlink to look as though it has been launched from the source rather than the target? |
You can store the utility in /usr/local/bin/ (source directory) and then create a symlink of it in /opt/myutil/bin (i.e. target directory) OR in your home directory, like this:
Code:
cd /opt/myutil/bin Code:
cd /home/username Code:
...... myutility -> /usr/local/bin/myutility |
Your utility might have an environment variable to control this (eg: ORACLE_HOME, JAVA_HOME, MOZILLA_HOME). Consult the manual. If it is so, create a script like this:
Code:
$ cat /usr/local/bin/myutil |
All times are GMT -5. The time now is 07:55 PM. |