Is it possible to run a shell script from any directory but the script keeps the directory context of where it is stored.
for example:
/projects/a/bin/myscript.sh
in projects/a i have:
- app
- code
- tmp
- bin
- myscript.sh
myscript sets up some things in the projects app and code directories.
I want to be able to run setup from anywhere i.e. :
./bin/setup.sh
or directly within the bin directory:
./setup.sh
but the context seems to be taken from where the script is run from and not where the file is located.