3 ms·no no no... god this is gross and awful SELF=${0##*/} # aka basename DIR=${0%/*} # aka dirnameby Brian_K_White 6y agono no no... god this is gross and awful SELF=${0##*/} # aka basename DIR=${0%/*} # aka dirnamedastx 6y agoRunning a script as sh script.sh returns only script.sh, thus, you've already got SELF, but you wouldn't get DIR.cat199 6y agobut, you don't need it since you are already there, and can just use $PWD (no need for `pwd`) from that point onward.