using THISDIR instead of WORKDIR
[feisty_meow.git] / infobase / examples / bashisms / script_location.sh
1
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 )"
7
8 # another slightly tighter version:
9 export THISDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
10