If you ask me, best to make all the paths absolute.

first attempt would be by storing `ROOT_DIR=$(pwd)` early on... but the problem is to guard against the script being run from a different directory.

so, more like:
http://stackoverflow.com/a/4774063/477229