Removing this scares me... I recall having issues before when i used just $(dirname "$0"). I recall it failing for certain scenarios. Setting it this way ensures it sets as a full path to bin regardless of where it's run from. I believe (and i might be wrong here) this approach sets BIN_DIR as a relative path and can then clash with other BIN_DIRs being set from child scripts.