Reputation: 2939
I have a script run.sh
located somewhere on read only directory /install/app/release_1.0.0/
and a symbolic link to that script in the fully accessed directory /packages/app/
. This script operates with files using relative paths. When I'm running this script using symbolic link it's not able to locate files because it's looking in the current directory of symbolic link. How can I force it to look into the current directory of link's target? Changing the script is not prefered.
Upvotes: 5
Views: 2920
Reputation: 168958
Don't use a symlink, use a wrapper instead. Remove /packages/app/run.sh
and create a new file at that location, with these contents:
#!/bin/sh
cd /install/app/release_1.0.0/
./run.sh
Mark it executable (chmod +x run.sh
) and that should do it.
Upvotes: 7