DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
Is a useful one-liner which will give you the full directory name of the script no matter where it is being called from
These will work as long as the last component of the path used to find the script is not a symlink (directory links are OK). If you want to also resolve any links to the script itself, you need a multi-line solution:
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink