hlzghw
Last Updated: February 25, 2016
·
1.286K
· sheerun
Photo on 08.01.2013 at 04.15

Get reliably the absolute path of currently executed script

CWD="$( 
  cd "$(dirname "$(readlink "$0" || printf %s "$0")")"
  pwd -P 
)"

PATH="$CWD:$PATH"

source sibling.sh # source file in the same directory

This works also for linked executables.

Say Thanks
Respond
Filed Under

Awesome Job

16280de8 7c1b 11e7 8768 5c1fc377b8ec
Python Developer
·
Papendrecht, the Netherlands
·
Full Time