The following line introduces the local variable PROGUARD_HOME
within a shell script:
PROGUARD_HOME=`dirname "$0"`/..
This points to the parent folder of the shell script. The script executes normally. - Then, I created the symlink /usr/local/bin/proguard
which refers to ~/bin/proguard4.10/bin/proguard.sh
. When I run proguard using the symlink PROGUARD_HOME
is no longer resolved correctly. This causes the following error message output by the shell script:
Error: Unable to access jarfile /usr/local/bin/../lib/proguard.jar
How can I rewrite the allocation of the enviroment variable so that it resolves an symbolic link if present? I am aware of a very similar question on resolving symbolic links in shell scripts but still cannot figure out how to combine those solutions with the parent folder approach here.