This question already has an answer here:
- determining path to sourced shell script 12 answers
I'm trying to get the path of the script that I'm sourcing. I'm doing the following:
DIR="$(dirname "$(readlink -f "$0")")"
Nevertheless I get
readlink: invalid option -- 'b'
I'm on a RedHat 6 machine using bash. Not sure if I'm suppose to do this in a different way.