2 # find out the location where this script is running from. this will not
3 # work properly in a bash script that is included via 'source' or '.'.
4 # the first letter of each command is escaped to eliminate the danger of
5 # personal aliases or functions disrupting the results.
6 ORIGINATING_FOLDER="$( \cd "$(\dirname "$0")" && /bin/pwd )"
8 # another slightly tighter version:
9 export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )" # obtain the script's working directory.