Can an executable know where it is stored?
For my open source project, I wrote a small bash script to automate some operations. The script lies at the root of the project and performs its tasks on all files below. People have the project files on their own computers, at their favorite path, so I can't just hardcode
cd /home/nico/projects/theproject at the beginning of the script. I don't want to force people to manually
cd to the project's directory everytime before executing either. I would like people to be able to use a Gnome shortcut to launch the script. To do so, the script needs to know where itself is stored.