I have this directory structure for an application: bin, config, lib.
In bin directory I have a bash script. I want to be able to set variables in the bash script for config and lib directories based on the location of the script file in the bin directory. I can get the directory name for script that is executing by doing:
BIN_DIR=”$( cd -P “$( dirname “${BASH_SOURCE[0]}” )” && pwd )”
My question is: How can I calculate the diectory paths for config and lib directories based on BIN_DIR ?
Thanks.
You can probably just use this: